Commit 8c6427bd by BellCodeEditor

save project

parent eac7142a
Showing with 11 additions and 7 deletions
import random import random
sb=['石头','剪刀','布']
# 玩家出拳 # 玩家出拳
sb1c = input('你出什么(石头/剪刀/布/)') sb1c = input('你出什么(石头/剪刀/布/)')
print('玩家出拳:'+sb1c) print('玩家出拳:'+sb1c)
#计算机 #计算机
sb=['石头','剪刀','布']
sb2c = random.choice(sb) sb2c = random.choice(sb)
print('计算机出拳:' + sb2c) print('计算机出拳:' + sb2c)
if sb2c==sb1c if sb1c in sb:
print('平局') if sb2c==sb1c:
elif sb1c=='布' and sb2c=='石头' or sb1c=='剪刀' and sb2c=='布' or sb1c=='石头' and sb2c=='剪刀': print('平局')
print(你赢了) elif sb1c=='布' and sb2c=='石头' or sb1c=='剪刀' and sb2c=='布' or sb1c=='石头' and sb2c=='剪刀':
print('你赢了')
else:
print('sb,你输了')
else: else:
print(sb,你输了) 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