标签:draw down back 绘制 rtl tag exit size import
""" 功能:五角星绘制,加入循环 """ import turtle def draw_pentagrm(size): count = 1 # 五角星绘制 while count <= 5: turtle.forward(size) turtle.right(144) count += 1 def main(): """ 主函数 """ turtle.penup() turtle.backward(200) turtle.pendown() turtle.pensize(2) turtle.pencolor(‘red‘) size = 50 while size <= 100: draw_pentagrm(size) size += 10 turtle.exitonclick() if __name__ == ‘__main__‘: main()
标签:draw down back 绘制 rtl tag exit size import
原文地址:https://www.cnblogs.com/llhhcc/p/9822911.html