Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def compare(x,y):
- if x > y:
- return 1
- elif x == y:
- return 0
- else:
- return -1
- prompt_x = "enter nuber x: "
- prompt_y = "enter number y: "
- x = input(prompt_x)
- y = input(prompt_y)
- if compare(x,y) == 1:
- print x,"is greater tnan",y
- else:
- if compare(x,y) == 0:
- print x,"and",y,"are equal"
- else:
- print x,"is less than",y
Add Comment
Please, Sign In to add comment