Commit ba7ff3c9 by BellCodeEditor

save project

parent e638bb63
Showing with 11 additions and 2 deletions
...@@ -4,4 +4,13 @@ i=input("玩家出拳/石头/剪刀/布:") ...@@ -4,4 +4,13 @@ i=input("玩家出拳/石头/剪刀/布:")
print("玩家出拳:"+i) print("玩家出拳:"+i)
A=["石头","剪刀","布"] A=["石头","剪刀","布"]
a = random.choice(A) a = random.choice(A)
print("电脑出拳:"+a) print("电脑出拳:"+a)
\ No newline at end of file if i in A:
if i==a:
print("平局")
elif (i=="石头"and a=="剪刀") or (i=="剪刀"and a=="布") or (i=="布"and a=="石头"):
print("你赢了")
else:
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