Commit 6bd405d3 by BellCodeEditor

auto save

parent ce18f42a
Showing with 11 additions and 15 deletions
# 玩家出拳 # 玩家出拳
while True: s=input("请输入石头/剪刀/布 ")
s=input("请输入石头/剪刀/布 ") print("玩家1 出拳:" + s)
print("玩家1 出拳:" + s) # 计算机出拳
# 计算机出拳 import random
import random list = ["石头","剪刀","布"]
list = ["石头","剪刀","布"] n=random.choice(list)
n=random.choice(list) print("玩家2 出拳:" + n)
print("玩家2 出拳:" + n) if s == n:
if s in list:
if s == n:
print("平局") print("平局")
elif (s == "石头" and n == "剪刀") or (s == "剪刀" and n == "布") or (s == "布" and n == "石头"): elif (s == "石头" and n == "剪刀") or (s == "剪刀" and n == "布") or (s == "布" and n == "石头"):
print("恭喜,你赢了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") print("恭喜,你赢了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
else: else:
print("很遗憾,你输了!!!!!!!!!") print("很遗憾,你输了!!!!!!!!!")
\ No newline at end of file
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