随机抽奖【python】

import turtle as tr
import random

lottery=list(range(1,5001))
print('抽奖号码一开始有5000个')
first=random.choice(lottery)
lottery.remove(first)
print('一等奖的号码是:',first)
print('现在的抽奖号码还有',len(lottery),'个')
print()
second_1=random.choice(lottery)
lottery.remove(second_1)
second_2=random.choice(lottery)
lottery.remove(second_2)
print('两个二等奖的号码是:',second_1,second_2)
print('现在的抽奖号码还要:',len(lottery),'个')
print()
third_1=random.choice(lottery)
lottery.remove(third_1)
third_2=random.choice(lottery)
lottery.remove(third_2)
third_3=random.choice(lottery)
lottery.remove(third_3)
print('三个三等级的号码是:',third_1,third_2,third_3)
print('剩下的未中奖的号码还有',len(lottery),'个')
print()

#画End
tr.showturtle()
tr.pensize(25)

#画E
tr.color('blue')
tr.penup()
tr.goto(-100,100)
tr.pendown()
tr.forward(100)

tr.penup()
tr.goto(-100,50)
tr.pendown()
tr.forward(61.8)

tr.penup()
tr.goto(-100,0)
tr.pendown()
tr.forward(100)

tr.left(90)
tr.penup()
tr.goto(-100,0)
tr.pendown()
tr.forward(100)

#画n
tr.color('green')
tr.penup()
tr.goto(0,0)
tr.pendown()
tr.forward(50)

tr.right(90)
tr.forward(50)

tr.right(90)
tr.forward(50)

#画d
tr.right(90)
tr.color('red')
tr.penup()
tr.goto(130,50)
tr.pendown()
tr.forward(50)

tr.left(90)
tr.forward(50)

tr.left(90)
tr.forward(50)

tr.left(90)
tr.forward(100)

tr.exitonclick()

你可能感兴趣的:(python,开发语言)