Commit 0d45d9b6 by BellCodeEditor

save project

parent 1e9fbe07
Showing with 9 additions and 6 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 :
print("平局") if q==o:
elif q=="石头" and o=="剪刀" or q=="布" and o=="石头" or q=="剪刀" and o=="布": print("平局")
print("玩家赢了") elif q=="石头" and o=="剪刀" or q=="布" and o=="石头" or q=="剪刀" and o=="布":
print("玩家赢了")
else:
print("计算机赢了")
else: else:
print("计算机赢了") print("输入错误")
\ No newline at end of file \ 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