宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

python红色五角星的代码是【fillcolor("red");begin_fill();while True:forward(200) right(144)if abs(pos()) < 1:break end_fill()】。

【相关学习推荐:python教程】

用python画红色五角星的代码是:

利用Python代码绘制一个红色的五角星

代码实现:

from turtle import *
fillcolor("red")
begin_fill()
while True:
forward(200)
right(144)
if abs(pos()) < 1:
break
end_fill()

输出结果: