-- coding = uft-8 --
@Time : 2021/7/8 0:02
@Author : ff
@File : 7.8猜拳.py
@Software : PyCharm
yours = int(input(“请输入:剪刀(0)、石头(1)、布(2):”))
import random #引入随机库
x = random.randint(0,2)
print(“你的输入为:”,yours)
print(“随机生成的数字为:”,x)
if yours == 0:
if x == 0:
print(“你白玩了”)
elif x == 1:
print(“你没了”)
elif x == 2:
print(“你中了”)
elif yours == 1:
if x == 0:
print(“你中了”)
elif x == 1:
print(“你白玩了”)
elif x == 2:
print(“你没了”)
elif yours == 2:
if x == 0:
print(“你没了”)
elif x == 1:
print(“你中了”)
elif x == 2:
print(“你白玩了”)