复制
收藏
提问
全网

import random # # 计算电脑出拳的随机数字 # computer=random.randint(0,2) # # print(computer) # player =int(input('请出拳:0-石头,1-剪刀,2-布:')) # #玩家胜利 p0:c1或p1:c2或p2:cO # if((player ==0)and(computer ==1))or((player == 1)and(computer==2))or((player ==2)and(computer == 0)): # print(f"电脑出的为:{computer}") # print('玩家获胜') # # 平局:玩家 == 电脑 # elif player == computer: # print(f"电脑出的为:{computer}") # print('平局') # else: # print(f"电脑出的为:{computer}") # print('电脑获胜')

纯真鬼才
2个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题import random # # 计算电脑出拳的随机数字 # computer=random.randint(0,2) # # print(computer) # player =int(input('请出拳:0-石头,1-剪刀,2-布:')) # #玩家胜利 p0:c1或p1:c2或p2:cO # if((player ==0)and(computer ==1))or((player == 1)and(computer==2))or((player ==2)and(computer == 0)): # print(f"电脑出的为:{computer}") # print('玩家获胜') # # 平局:玩家 == 电脑 # elif player == computer: # print(f"电脑出的为:{computer}") # print('平局') # else: # print(f"电脑出的为:{computer}") # print('电脑获胜')

已完成理解import random # # 计算电脑出拳的随机数字 # computer=random.randint(0,2) # # print(computer) # player =int(input('请出拳:0-石头,1-剪刀,2-布:')) # #玩家胜利 p0:c1或p1:c2或p2:cO # if((player ==0)and(computer ==1))or((player == 1)and(computer==2))or((player ==2)and(computer == 0)): # print(f"电脑出的为:{computer}") # print('玩家获胜') # # 平局:玩家 == 电脑 # elif player == computer: # print(f"电脑出的为:{computer}") # print('平局') # else: # print(f"电脑出的为:{computer}") # print('电脑获胜')

展开阅读网页

更专业一些
转笔记
专业
import random # # 计算电脑出拳的随机数字 # computer=random.randint(0,2) # # print(computer) # player =int(input('请出拳:0-石头,1-剪刀,2-布:')) # #玩家胜利 p0:c1或p1:c2或p2:cO # if((player ==0)and(computer ==1))or((player == 1)and(computer==2))or((player ==2)and(computer == 0)): # print(f"电脑出的为:{computer}") # print('玩家获胜') # # 平局:玩家 == 电脑 # elif player == computer: # print(f"电脑出的为:{computer}") # print('平局') # else: # print(f"电脑出的为:{computer}") # print('电脑获胜')
不在提醒

更专业内容正在努力生成中
知识树
import random # # 计算电脑出拳的随机数字 # computer=random.randint(0,2) # # print(computer) # player =int(input('请出拳:0-石头,1-剪刀,2-布:')) # #玩家胜利 p0:c1或p1:c2或p2:cO # if((player ==0)and(computer ==1))or((player == 1)and(computer==2))or((player ==2)and(computer == 0)): # print(f"电脑出的为:{computer}") # print('玩家获胜') # # 平局:玩家 == 电脑 # elif player == computer: # print(f"电脑出的为:{computer}") # print('平局') # else: # print(f"电脑出的为:{computer}") # print('电脑获胜')
如何优化Python游戏的用户交互体验?
Python中有哪些生成随机数的方法?
如何设计一个多轮石头剪刀布游戏?

以上内容由AI搜集生成,仅供参考

在线客服