由来:(小白学习Python) 疯狂的Python:快速入门精讲
参考资料1:10分钟轻松学会 Python turtle 绘图
p = input('请输入国旗高度') # 国旗尺寸
p = float(p)
a = 1.9 # 一些重要数值
b = 1.0
c = 1.9*2/5
d = 7/13
e = c/12
f = d/10
k = 0.0616
l = 1/13
m = 0.37
import turtle as t
t.setup(width=a*p, height=b*p) # 设置画布大小
t.pencolor(0.698,0.132,0.203) # 设置颜色1
t.fillcolor(0.698,0.132,0.203) # 设置颜色2
t.speed(0) # 设置画笔速度
for n1 in range(0,7): # 画红色条纹
t.penup()
t.goto(-0.5*a*p,0.5*b*p-n1*2*l*p)
t.begin_fill()
for n2 in range(2):
t.forward(a*p)
t.right(90)