Programing Challenge - Let's Compare Stuff

Using if, elif to do comparisons - Python3

Programing Challenge  -Define a procedure compare(x,y) that returns 1 if x is greater than y, 0 if x equals y and -1 if x is less than y. Use elif to write the comparison.

def compare(a,b):
<put your code here>
  
def main():
     x=4
     y=4
    print(compare(x,y))

main()


No comments:

Post a Comment