Commit e60acedf by BellCodeEditor

auto save

parent c66a449e
Showing with 48 additions and 0 deletions
import turtle
p=turtle.Pen()
p.pencolor('blue')
q.turtle.Pen()
p.fillcolor('yellow')
p.begin_fill()
for i in range(100):
p.forward(18)
p.right(10)
p.end_fill()
turtle.done()
n=int(input())
c=0
a=[]
b=[]
for i in range(n):
a.append(i+1)
print(a)
while len(a)!=1:
a.append(a.pop(0))
c=c+1
if c==3:
a.pop(0)
c=1
print(a)
\ No newline at end of file
import random
list1=['石头','剪刀','布']
for i in range(3):
player=input('请出拳:石头/剪刀/布')
print('玩家出拳是:'+player)
if player in list1:
computer=random.choice(list1)
print('电脑出拳:'+computer)
if player==computer:
print('平局')
elif player=='石头'and computer=='剪刀':
print('你赢了')
elif player=='剪刀'and computer=='布':
print('你赢了')
elif player=='布'and computer=='石头':
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