#coding=utf-8
import random
#石頭剪刀布遊戲
def userInput():
while True:
user_input = input('請輸入"石頭""剪刀""布":')
computer_list = ['石頭','剪刀','布']
random_put = random.choice(computer_list)
if user_input == random_put:
print(f'你出 【{user_input}】,電腦出 【{random_put}】,所以平局')
elif user_input == '石頭' and random_put == '剪刀' \
or user_input == '剪刀' and random_put == '布' \
or user_input == '布' and random_put == '石頭' :
print(f'你出 【{user_input}】,電腦出 【{random_put}】,你贏了')
elif user_input == '石頭' and random_put == '布' \
or user_input == '剪刀' and random_put == '石頭' \
or user_input == '布' and random_put == '剪刀':
print(f'你出 【{user_input}】,電腦出 【{random_put}】,你輸了哦')
else:
print('輸入錯誤!')
break
userInput()