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

posted @ 2021-05-29 21:17  Notus(Java)  阅读(185)  评论(0编辑  收藏  举报