![](https://img-blog.csdnimg.cn/img_convert/9c2acf4cc4502a0c17ce9f8295a6d5c4.png)
import turtle, datetime
import random as r
def drawGap(): # 绘制数码管间隔
turtle.penup()
turtle.fd(5)
def drawLine(draw): # 绘制单段数码管
drawGap()
turtle.pendown() if draw else turtle.penup()
turtle.pencolor(r.random(),r.random(),r.random())
turtle.fd(40)
drawGap()