import random while True : computer =random.randint(0,2) #print('computer---->%d'%computer) player = int(input('請選擇0,剪刀1,石頭,2,布:')) if player<=3: if (player==0 and computer==2)or(player==2 and computer==1)or(player==1 and computer==0): print('你贏了,我隨你玩') elif player == computer: print('平局,再戰300回合') else: print('你輸了,爆你菊花') else: print('輸入錯誤')