Python can draw a Sunflower

本篇文章记录Python学习过程中遇到的一些有趣的代码。

Sunflower drawing:
draw a Sunflower

Code:

from turtle import *
color('red','yellow')
begin_fill()
while True:
	forward(200)
	left(170)
	if abs(pos()) < 1:
		break
end_fill()
done()

Output:
Sunflower

FIG as the final output.

Released seven original articles · won praise 8 · views 111

Guess you like

Origin blog.csdn.net/qq_44265375/article/details/104878778