目录
优点:
根据老师进度编写,小白一枚,只为记录每次进步,欢迎大家提出意见与建议。
答案一:
#用户
user = int(input('请输入:剪刀(0)、石头(1)、布(2):'))
if user == 0 :
chinese = "剪刀"
elif user == 1:
chinese = "石头"
else:
chinese = "布"
print("你的输入为%s(%d)"%(chinese,user))
#电脑
import random #调用随机库
computer=random.randint(0,2)
print("随机生成数字为%d"%computer)
#判断输赢
if user == 0 and computer == 0 :
print("哈哈,这次不算再来一次吧!")
if user == 0 and computer == 1 :
print("哈哈,你赢了!)")
if user == 0 and computer ==2 :
print("哈哈,你输了!")
elif user == 1 and computer == 0 :
print("哈哈,你赢了!")
if user=