I'm a noobie, learning to code and i stumbled upon an incorrect output while practicing a code in python, please help me with this. I tried my best to find the problem in the code but i could not find it.
Code:
def compare(x,y):
if x>y:
return 1
elif x==y:
return 0
else:
return -1
i=raw_input("enter x\n")
j=raw_input("enter y\n")
print compare(i,j)
Output:
-> python python.py
enter x
10
enter y
5
-1
The output that i had to receive is 1 but the output that i receive is -1. Please help me with the unseen error in my code.
Thank you.