Commit b59cb0e7 by BellCodeEditor

save project

parent a74a11a4
Showing with 8 additions and 2 deletions
...@@ -3,4 +3,10 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳 ...@@ -3,4 +3,10 @@ player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player) print("玩家出拳:"+player)
alist=['石头','剪刀','布'] alist=['石头','剪刀','布']
comp=random.choice(alist) comp=random.choice(alist)
print("电脑出拳:"+comp) print("电脑出拳:"+comp)
\ No newline at end of file if player==comp:
print('平局')
elif (player=='布' and comp=='石头') or (player=='剪刀' and comp=='布') or (player=='石头' and comp=='剪刀'):
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