Commit 9bc9ef61 by BellCodeEditor

save project

parent 11a660bd
Showing with 11 additions and 7 deletions
......@@ -4,9 +4,13 @@ print("玩家出拳:"+player)
alist=['石头','剪刀','布']
comp=random.choice(alist)
print("电脑出拳:"+comp)
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
if player in alist:
if player==comp:
print('平局')
elif (player=='布' and comp=='石头') or (player=='剪刀' and comp=='布') or (player=='石头' and comp=='剪刀'):
print('玩家胜利')
else :
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