Commit 30f00aa1 by BellCodeEditor

save project

parent 3627f418
Showing with 8 additions and 3 deletions
...@@ -4,10 +4,14 @@ import random ...@@ -4,10 +4,14 @@ import random
l=['石头','剪刀','布'] l=['石头','剪刀','布']
i=random.choice(l) i=random.choice(l)
print('计算机随机出拳:'+i) print('计算机随机出拳:'+i)
if player==i: if player in 'l':
if player==i:
print('平局') print('平局')
elif i=='石头' and player=='剪刀' or i=='剪刀' and player=='布' or i=='布' and player=='石头' : elif i=='石头' and player=='剪刀' or i=='剪刀' and player=='布' or i=='布' and player=='石头' :
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