Commit 2b28802d by BellCodeEditor

save project

parent c3d1b08d
Showing with 12 additions and 2 deletions
...@@ -5,4 +5,14 @@ print("玩家出拳是:"+player) ...@@ -5,4 +5,14 @@ print("玩家出拳是:"+player)
import random import random
list=["剪刀","石头","布"] list=["剪刀","石头","布"]
n=random.choice(list) n=random.choice(list)
print("电脑出拳是:"+n) print("电脑出拳是:"+n)
\ No newline at end of file if n==player:
print("平局")
elif(n=="剪刀"and player=="石头"):
print("恭喜!你赢了!")
elif(n=="石头"and player=="布"):
print("恭喜!你赢了!")
elif(n=="布"and player=="剪刀"):
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