Commit 11b2d705 by BellCodeEditor

save project

parent 7f001875
Showing with 13 additions and 10 deletions
...@@ -6,13 +6,16 @@ while True: ...@@ -6,13 +6,16 @@ while True:
lis=['石头','剪刀','布'] lis=['石头','剪刀','布']
com=random.choice(lis) com=random.choice(lis)
print("电脑出拳:"+com) print("电脑出拳:"+com)
if com==player: if player in lis:
print('平局') if com==player:
elif com=='石头' and player=='布': print('平局')
print('win') elif com=='石头' and player=='布':
elif com=='布' and player=='剪刀': print('win')
print('win') elif com=='布' and player=='剪刀':
elif com=='剪刀' and player=='石头': print('win')
print('win') elif com=='剪刀' and player=='石头':
print('win')
else:
print('lose')
else: else:
print('lose') print('mistake')
\ 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