亲爱的朋友们,今天我们要探讨,python在手机上怎么操作 手机上的python怎么运行,一起探索吧!
#(1)七段数码管的绘制.py #(2)导入库模块 from random import * from time import * from turtle import * #(3)绘制单段间隔 def drawGap(): penup() fd(5) #(4)绘制单段数码管 def drawLine(draw): drawGap(); if draw: pendown() else: penup() fd(40) drawGap() right(90) #(5)随机颜色 def pencolort(): pencolor(random(),random(),random()) #(6)根据数字绘制七段数码管 def drawDigit(digit): #第1段 pencolort() drawLine(True) if digit in [2,3,4,5,6,8,9] else drawLine(False) #第2段 pencolort() drawLine(True) if digit in [0,1,3,4,5,6,7,8,9] else drawLine(False) #第3段 pencolort() drawLine(True) if digit in [0,2,3,5,6,8] else drawLine(False) #第4段 pencolort() drawLine(True) if digit in [0,2,6,8] else drawLine(False)
原文地址1:https://blog.csdn.net/weixin_65663984/article/details/130279081
参考资料:python中用turtle画一个圆形 https://blog.csdn.net/SXIAOYAN_/article/details/140061099