Commit 8bc5cdbf by BellCodeEditor

save project

parent 99b9fbcc
Showing with 8 additions and 4 deletions
...@@ -4,13 +4,16 @@ print("玩家出拳:"+player) ...@@ -4,13 +4,16 @@ print("玩家出拳:"+player)
printlist=["1","2","3"] printlist=["1","2","3"]
robot=random.choice(list) robot=random.choice(list)
print("robot:"+robot) print("robot:"+robot)
if player==robot: if player in list:
if player==robot:
print("平局") print("平局")
elif player=="石头"and robot=="2": elif player=="石头"and robot=="2":
print("win") print("win")
elif player=="剪刀"and robot=="3": elif player=="剪刀"and robot=="3":
print("win") print("win")
elif player=="布"and robot=="1": elif player=="布"and robot=="1":
print("win") print("win")
else:
print("lose")
else: else:
print("lose") print("lose")
\ 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