Day034.五角星的绘制

Codes

'''
    五角星的绘制:绘制一个红色的五角星图形,图案见下方输出。
    @Ref 2017.Python语言程序设计基础.第2版.嵩天, p30
    @Version: v0.1, Python 3.9.5, Notus(hehe_xiao@qq.com), 2021.05.29
    @Updated: 2021.05.29
'''

from turtle import *
# fillcolor("red")
# color('red')
color('red', 'red')
begin_fill()
while True:
    forward(200)
    right(144)
    if (abs(pos()) < 1):            # return to the original position
        break
end_fill()
done()

Outputs

原文地址:https://www.cnblogs.com/leo1875/p/14826394.html