Commit eba94674 by BellCodeEditor

save project

parent 84f521db
Showing with 9 additions and 2 deletions
...@@ -3,5 +3,12 @@ import random ...@@ -3,5 +3,12 @@ import random
player=input("请出拳") player=input("请出拳")
print("玩家出拳:"+player) print("玩家出拳:"+player)
cp=["石头","剪刀","布"] cp=["石头","剪刀","布"]
print(random.choice(cp)) cp=random.choice(cp)
print("计算机"+cp)
if cp==player:
print("平局")
elif (cp=="布" and player=="剪刀") or (cp=="剪刀" and player=="石头") or (cp=="石头" and player=="布"):
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