Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

How to draw color filled star in Python-Turtle?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Prerequisite: Turtle Programming Basics, Draw Color Filled Shapes in Turtle

Turtle is an inbuilt module in Python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle (pen). To move the turtle, there are some functions i.e forward(), backward(), etc.


The following steps are used:

  • Import turtle
  • Set window screen
  • Set color of the turtle
  • Form a star
  • Fill the star with the color

Below is the implementation.


# importing package
import turtle
# function to draw
# colored star
def colored_star():
    # size of star
    size = 80
    # object color
    # object width
    # angle to form star
    angle = 120
    # color to fill
    # form star
    for side in range(5):
        turtle.right(72 - angle)
    # fill color
# Driver code


Output :


Since, as of now, you must have learned how to draw and fill color in a star. So, let’s try something unique with this knowledge. Let’s use some creativity and programming to build a night full of stars.


import turtle
from random import randint
window = turtle.Screen()
def draw_star():
    turns = 6
    while turns>0:
        turns = turns-1
nums_stars = 0
while nums_stars <50:
    nums_stars = nums_stars + 1


My Personal Notes arrow_drop_up
Last Updated : 08 Oct, 2020
Like Article
Save Article
Similar Reads
Related Tutorials