Commit 42ba8104 by BellCodeEditor

save project

parent 1bb55b9d
Showing with 7 additions and 2 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:
...@@ -19,3 +21,5 @@ for i in range(0,int(guanqiashu),1): ...@@ -19,3 +21,5 @@ for i in range(0,int(guanqiashu),1):
pri() pri()
else: else:
print("电脑胜利") print("电脑胜利")
else:
print("输入错误")
\ 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