Help with code

python
python_3

#1


So I made this code on my own in python 3.5, but when I run it, it always comes out with the phrase "You Lose." even when you don't. It is supposed to be a Rock, Paper, Scissors Simulator, but it doesn't seem to work. If you can help me, please do.


import random
x = random.randint(0, 2)
user_input = input("""Welcome to Rock, Paper, Scissors
Rock = 0
Paper = 1
Scissors = 2
Take your pick: """)
if x == user_input:
    print ("A tie has occured")
elif x == 1 and user_input == 2:
    print ("You win: Scissors beat Paper.")
elif x == 0 and user_input == 1:
    print ("You win: Paper beats Rock.")
elif x == 2 and user_input == 0:
    print ("You win: Rock beats Scissors")
else:
    print ("You lose.")


#2

input gives you a sting, you will need to cast it to a integer:

int(input("""Welcome to Rock, Paper, Scissors
Rock = 0
Paper = 1
Scissors = 2
Take your pick: """))

#3

Thanks for the help, this fixed it.