Commit 0b89191f by BellCodeEditor

save project

parent 2afd4a71
Showing with 24 additions and 0 deletions
import random as r
i=0
while i<1:
player = input('请出拳(石头/剪刀/布):\n')
if player == '石头' or player == '剪刀' or player == '布':
computer = r.choice(['石头','剪刀','布'])
print(f'''
玩家出拳:{player}
电脑出拳:{computer}''')
if player == computer:
print('平局')
elif player=='石头' and computer == '剪刀' or player == '剪刀' and computer == '布' or player == '布' and computer == '石头':
print('玩家赢')
else:
print('玩家输')
else:
print('请输入符合游戏规则的选项。')
a=input('是否继续游戏?\n')
if a == '是':
print('游戏继续')
else:
i=1
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