
用Python画五角星的方法
打开电脑上安装好的Python编辑器
导入 turtle 模块并定义一个名字
接着输入如下代码:
t.color('red','white')
t.begin_fill()
for i in range(5):
t.fd(200)
t.right(144)
t.end_fill()
然后按F5运行代码,就可以看到五角星的效果了

用Python画五角星的方法
打开电脑上安装好的Python编辑器
导入 turtle 模块并定义一个名字
接着输入如下代码:
t.color('red','white')
t.begin_fill()
for i in range(5):
t.fd(200)
t.right(144)
t.end_fill()
然后按F5运行代码,就可以看到五角星的效果了