Commit 3abd9309 by BellCodeEditor

save project

parent 855efe99
Showing with 12 additions and 2 deletions
...@@ -5,4 +5,14 @@ while True: ...@@ -5,4 +5,14 @@ while True:
print("玩家出拳:"+player) print("玩家出拳:"+player)
lis=['石头','剪刀','布'] lis=['石头','剪刀','布']
com=random.choice(lis) com=random.choice(lis)
print(com) print("电脑出拳:"+com)
\ No newline at end of file if com==player:
print('平局')
elif com=='石头' and player=='布':
print('win')
elif com=='布' and player=='剪刀':
print('win')
elif com=='剪刀' and player=='石头':
print('win')
else:
print('lose')
\ 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