#七段电子管绘制
from turtle import *
from time import *
def drawLine(draw):
pendown() if draw else penup()
fd(80)
right(90)
def drawDight(i):
drawLine(True) if i in [2,3,4,5,6,8,9] else drawLine(False)
drawLine(True) if i in [0,1,3,4,5,6,7,8,9] else drawLine(False)
drawLine(True) if i in [0,2,3,5,6,8,9] else drawLine(False)
drawLine(True) if i in [0,2,6,8] else drawLine(False)
left(90)
drawLine(True) if i in [0,4,5,6,8,9] else drawLine(False)
drawLine(True) if i in [0,2,3,5,6,7,8,9] else drawLine(False)
drawLine(True) if i in [0,1,2,3,4,7,8,9] else drawLine(False)
left(180)
penup()
fd(20)
def drawDate(date):
for i in date:
drawDight(eval(i))
def main():
setup(1000,350,200,200)
penup()
fd(-400)
pensize(5)
pencolor('red')
drawDate('5201314')
hideturtle()
done()
main()