Commit 0d45d9b6 by BellCodeEditor

save project

parent 1e9fbe07
Showing with 7 additions and 3 deletions
...@@ -4,9 +4,12 @@ print("玩家出拳:"+q) ...@@ -4,9 +4,12 @@ print("玩家出拳:"+q)
a=['石头','剪刀','布'] a=['石头','剪刀','布']
o=random.choice(a) o=random.choice(a)
print("计算机出拳:"+o) print("计算机出拳:"+o)
if q==o: if q in a :
if q==o:
print("平局") print("平局")
elif q=="石头" and o=="剪刀" or q=="布" and o=="石头" or q=="剪刀" and o=="布": elif q=="石头" and o=="剪刀" or q=="布" and o=="石头" or q=="剪刀" and o=="布":
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