import random
print('Welcome to the rock paper scissor game')
user_choice = int((input('Write a number to select a tool (rock=1,paper=2, scissors=3): ')))
def game():
x = 'is a tie'
y = 'u lose'
z = 'u win'
options = ['rock', 'paper','scissors']
computer_choice = random.choice((1,2,3))
if 0 < user_choice <= 3:
print('computer selected ' + options[computer_choice - 1])
print('u selected ' + options[user_choice - 1])
if user_choice == 1:
if computer_choice == 1:
print(x)
elif computer_choice == 2:
print(y)
else:
print(z)
if user_choice == 2:
if computer_choice == 1:
print(z)
elif computer_choice == 2:
print(x)
else:
print(y)
if user_choice == 3:
if computer_choice == 1:
print(y)
elif computer_choice == 2:
print(z)
else:
print(x)
else:
print('Unvalid number, please run code again')
game()