- 博客(2)
- 收藏
- 关注
原创 【习题1】用Python编写猜拳游戏
import random # 调用随机库 # 用户 user = int(input('请输入:剪刀(0)、石头(1)、布(2):')) if user == 1 and user != 0: chinese = "石头" elif user == 0: chinese = "剪刀" else: chinese = "布" print("你的输入为%s(%d)"%(chinese,user)) # 电脑 computer = random.randint(0,2) pri...
2022-04-29 04:00:00 476
原创 【习题1】用Python编写猜拳游戏
目录 答案1import random # 调用随机库# 用户user = int(input('请输入:剪刀(0)、石头(1)、布(2):')) if user == 1 and user != 0: chinese = "石头"elif user == 0: chinese = "剪刀"else: chinese = "布"print("你的输入为%s(%d)"%(chinese,user))# 电脑computer = random.randint(0,2)print("随...
2022-04-28 20:32:46 1822
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人