I do not know why the program i wrote does not work and i really want to know.
I've looked at many codes that work, but i still want to know why the code that I wrote does not work
user1_input = input(" User 1 choose your pick: Rock = 1, Scissor = 2, paper = 3 \n:")
user2_input = input(" User 2 choose your pick: Rock = 1, Scissor = 2, paper = 3 \n:")
def compare(user1_input,user2_input):
if user1_input == user2_input:
return("It is a tie!")
elif user1_input == 1:
if user2_input == 2:
return("User 1 Wins")
else:
return("User 1 lose")
elif user1_input == 2:
if user2_input == 1:
return("User 1 loses")
else:
return("User 1 wins")
elif user1_input == 3:
if user2_input == 1:
return("User 1 wins")
else:
return("User 1 loses")
else:
return("Invalid input!")
print(compare(user1_input,user2_input))
if you put in 3 for user 1 and 1 for user 2, it is supposed to say User 1 loses, but it keeps saying invalid input.