Commit b184d803 by BellCodeEditor

save project

parent 8f5199ab
Showing with 12 additions and 6 deletions
...@@ -7,11 +7,17 @@ ...@@ -7,11 +7,17 @@
# for i in range(5): # for i in range(5):
# pen.forward(100) # pen.forward(100)
# pen.right(144) # pen.right(144)
# pen.end_fill() # pen.end_fill()
# turtle.done() # turtle.done()
# player=input("你想出什么(石头/剪刀/布):")
# print("玩家出拳:"+player)
import random import random
player=input("你想出什么(石头/剪刀/布):")
print("玩家出拳:"+player)
lite=["石头","剪刀","布"] lite=["石头","剪刀","布"]
robot=random.choice(lite) robot=random.choice(lite)
print(robot) print(robot)
\ No newline at end of file if player==robot:
print("平局")
elif(player=="石头" and robot=="剪刀") or (player=="剪刀" and robot=="布") or (player=="布" and robot=="石头"):
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