Commit 8a36636e by BellCodeEditor

save project

parent fbb6ec9e
Showing with 14 additions and 11 deletions
import random
a=input("请輸入石头/剪刀/布")
#print("玩家请出拳"+a)
#c=["石头","剪刀","布"]
#d=random.choice(c)
#print("计算机出的是"+d)
#if a==d:
# print("平局")
#elif a=="石头" and d=="剪刀" or a=="剪刀" and d=="布" or a=="布" and d=="石头":
# print("玩家胜")
#else:
# print("计算机胜")
\ No newline at end of file
print("玩家请出拳"+a)
c=["石头","剪刀","布"]
d=random.choice(c)
print("计算机出的是"+d)
if a in c:
if a==d:
print("平局")
elif a=="石头" and d=="剪刀" or a=="剪刀" and d=="布" or a=="布" and d=="石头":
print("玩家胜")
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