Commit a09c995d by BellCodeEditor

save project

parent 78ea3f77
Showing with 9 additions and 1 deletions
...@@ -14,8 +14,16 @@ a=input("请出拳剪刀或石头或布") ...@@ -14,8 +14,16 @@ a=input("请出拳剪刀或石头或布")
print("玩家出拳:",a)''' print("玩家出拳:",a)'''
import random import random
list=['剪刀','石头','布'] list=['剪刀','石头','布']
a=input("请出拳剪刀或石头或布") a=input("请出拳剪刀或石头或布")
b=random.choice(list) b=random.choice(list)
print("玩家出拳:",a) print("玩家出拳:",a)
print("电脑出拳",b) print("电脑出拳",b)
while True:
if a==b
print("平局")
elif a=="剪刀" and b=="布" or a=="布" and b=="石头" or a=="石头" and b=="剪刀"
print("玩家胜利")
else:
print("电脑胜利")
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