Commit 42ba8104 by BellCodeEditor

save project

parent 1bb55b9d
Showing with 18 additions and 14 deletions
import random
def pri(): def pri():
print("你赢") print("你赢")
guanqiashu=input("数量:") guanqiashu=input("数量:")
for i in range(0,int(guanqiashu),1): for i in range(0,int(guanqiashu),1):
list=["剪刀","石头","布"]
passs=input("玩家请出拳(石头/剪刀/布):") passs=input("玩家请出拳(石头/剪刀/布):")
print("玩家出拳:\n ",passs) print("玩家出拳:\n ",passs)
#计算机出拳 #计算机出拳
import random if passs in list:
list=["剪刀","石头","布"] hello=random.choice(list)
hello=random.choice(list) print("电脑出拳:\n",hello)
print("电脑出拳:\n",hello) if passs==hello:
if passs==hello: print("平局")
print("平局") elif passs=="石头" and hello=="剪刀":
elif passs=="石头" and hello=="剪刀": pri()
pri() elif passs=="剪刀" and hello=="布":
elif passs=="剪刀" and hello=="布": pri()
pri() elif passs=="布" and hello=="石头":
elif passs=="布" and hello=="石头": pri()
pri() else:
print("电脑胜利")
else: else:
print("电脑胜利") print("输入错误")
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment