Commit 9e53674f by BellCodeEditor

save project

parent d6939279
Showing with 14 additions and 6 deletions
name=['Jonh','Sam','Nina','Anna','Daming','Sally','Helen']
name.extend(["xiaoli","Qiang","Neo"])
print(name)
name[2:7]
print(name[2:7])
...@@ -4,9 +4,12 @@ print("玩家出拳:"+player) ...@@ -4,9 +4,12 @@ print("玩家出拳:"+player)
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
robot=random.choice(list) robot=random.choice(list)
print("计算机出拳"+robot) print("计算机出拳"+robot)
if player==robot: if player in list:
print("平局") if player==robot:
elif (player=="石头" and robot=="剪刀") or (player=="布" and robot=="石头") or (player=="剪刀" and robot=="布"): print("平局")
print("恭喜你赢了!") elif (player=="石头" and robot=="剪刀") or (player=="布" and robot=="石头") or (player=="剪刀" and robot=="布"):
print("恭喜你赢了!")
else:
print("抱歉你输了")
else: else:
print("抱歉你输了") print("输入错误")
\ No newline at end of file \ 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