Commit 9e53674f by BellCodeEditor

save project

parent d6939279
Showing with 12 additions and 3 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)
list=["石头","剪刀","布"]
robot=random.choice(list)
print("计算机出拳"+robot)
if player==robot:
if player in list:
if player==robot:
print("平局")
elif (player=="石头" and robot=="剪刀") or (player=="布" and robot=="石头") or (player=="剪刀" and robot=="布"):
elif (player=="石头" and robot=="剪刀") or (player=="布" and robot=="石头") or (player=="剪刀" and robot=="布"):
print("恭喜你赢了!")
else:
else:
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