Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Turtle graphics, draw a filled star?

$
0
0

I want to draw a filled-in star, such as:

http://www.seaviewstickers.co.uk/shop/media/catalog/product/cache/1/thumbnail/600x600/9df78eab33525d08d6e5fb8d27136e95/b/l/black_11.jpg

I have this code so far:

def draw_star(size,color):    count = 0    angle = 144    while count <= 5:        turtle.forward(size)        turtle.right(angle)        count += 1    returndraw_star(100,"purple")

I want to fill in the star with whatever color the function is passed. How can I do this?


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>