Commit 9f1a1650 by BellCodeEditor

save project

parent 5f80b7f9
Showing with 14 additions and 14 deletions
# 玩家出拳 # 玩家出拳
import random import random
c=['布','剪刀','石头']
c[0]<c[2]
c[1]<c[0]
c[2]<c[1]
computer=random.randint(c)
a=input('请输入:') a=input('请输入:')
if a==c: c1=['布','剪刀','石头']
print('平局') computer=str(random.choices(c1))
if a>c: print('player:',a)
print('你赢了') print('computer:',computer)
if a<c: if a in c1:
print('你输了') if a==computer:
print('平局')
elif (a=='布' and computer=='石头') or (a=='石头' and computer=='剪刀') or (a=='布' and computer=='石头'):
\ No newline at end of file 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