Commit 299cb5f0 by BellCodeEditor

save project

parent 9908e5af
Showing with 31 additions and 8 deletions
# 玩家出拳 score=0
s=input('请输入:') while True:
print('玩家出:'+s) s=input('请输入:')
import random print('玩家出:'+s)
a=['石头','剪刀','布'] import random
c=random.choice(a) a=['石头','剪刀','布']
print('人机出:'+c) c=random.choice(a)
\ No newline at end of file print('人机出:'+c)
if s in a:
if s==c:
print('平局')
print(score)
elif s=='石头'and c=='布':
print('输了')
score=score-1
print(score)
elif s=='布'and c=='剪刀':
print('输了')
score=score-1
print(score)
elif s=='剪刀'and c=='石头':
print('输了')
score=score-1
print(score)
else:
print('赢了')
score=score+1
print(score)
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