Commit b06f3e1e by BellCodeEditor

auto save

parent 8617a0ef
Showing with 7 additions and 3 deletions
import random import random
player=input("玩家出拳") player=input("玩家出拳")
print("玩家出拳结果:"+player) print("玩家出拳结果:"+player)
a=["石头","剪刀","布"] #玩家出拳结果
list=["石头","剪刀","布"]
computer=random.choice(a) computer=random.choice(a)
print("电脑出拳结果:"+computer) print("电脑出拳结果:"+computer)
#电脑出拳结果
if player in a: if player in a:
if player==computer: if player==computer:
print("平局") print("平局")
...@@ -11,5 +13,7 @@ if player in a: ...@@ -11,5 +13,7 @@ if player in a:
print("你赢了") print("你赢了")
else: else:
print("你输了") 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