Commit 1a3fd3db by BellCodeEditor

save project

parent 7deae239
Showing with 11 additions and 9 deletions
import random import random
while True: while True:
player=input("请出拳:石头/剪刀/布")# 玩家出拳 player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player) print("玩家出拳:"+player)
list=['石头','剪刀','布'] list=['石头','剪刀','布','god']
a=random.choice(list) a=random.choice(list)
print(a) print(a)
if player ==a: if player in list:
print("平") if player == a :
elif (player=='石头' and a=='剪刀') or (player=='剪刀' and a=='布') or (player=='布' and a=='石头'): print("平")
print("赢") elif (player=='石头' and a=='剪刀') or (player=='剪刀' and a=='布') or (player=='布' and a=='石头') or (player=='god'):
print("赢")
else:
print("输")
else: else:
print("输") print("error")
\ 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