Commit 5d5b58f3 by BellCodeEditor

save project

parent df3bf186
Showing with 10 additions and 7 deletions
...@@ -18,9 +18,12 @@ while True: ...@@ -18,9 +18,12 @@ while True:
list1=["石头","剪刀","步"] list1=["石头","剪刀","步"]
b=random.choice(list1) b=random.choice(list1)
print("计算机出拳:",b) print("计算机出拳:",b)
if a==b: if a in b:
print("平局") if a==b:
elif (a=="剪刀" and b=="布") or (a=="布" and b=="石头") or (a=="石头" and b=="剪刀"): print("平局")
print("玩家胜") elif (a=="剪刀" and b=="布") or (a=="布" and b=="石头") or (a=="石头" and b=="剪刀"):
else : print("玩家胜")
print("机器胜") else :
\ No newline at end of file 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