用python写猜拳游戏

import random
x = int(input("请输入:剪刀(0)、石头(1)、布(2):"))
print("您的输入为:",x)
y = random.randint(0,2)
print("机器人出的是",y)
if x==y:
    print("平局")
elif x==0 and y==1:
    print("哈哈,你输了")
elif x==0 and y==2:
    print("太厉害了,你赢了")
elif x==1 and y==0:
    print("太厉害了,你赢了")
elif x==1 and y==2:
    print("哈哈,你输了")
elif x==2 and y==0:
    print("哈哈,你输了")
elif x==2 and y==1:
    print("太厉害了,你赢了")

你可能感兴趣的:(python)