Commit c289d524 by BellCodeEditor

save project

parent 28f75042
Showing with 8 additions and 3 deletions
...@@ -4,10 +4,14 @@ print("玩家出拳"+lll) ...@@ -4,10 +4,14 @@ print("玩家出拳"+lll)
k=["石头","剪刀","布"] k=["石头","剪刀","布"]
letter=random.choice(k) letter=random.choice(k)
print("计算机出拳"+letter) print("计算机出拳"+letter)
if lll==letter: if lll in k:
if lll==letter:
print("平局") print("平局")
elif lll=="剪刀" and letter=="布" or lll=="布" and letter=="石头" or lll=="石头" and letter=="剪刀": elif lll=="剪刀" and letter=="布" or lll=="布" and letter=="石头" or lll=="石头" and letter=="剪刀":
print("玩家赢") print("玩家赢")
else: else:
print("计算机赢") 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