Create A Star Using Python Turtle

In this tutorial, we are going to show and explain How To Create A Star Using Python Turtle We have added the video tutorial and the source code of the program.

So let us begin with How To Create A Star Using Python Turtle.

 

Video Tutorial: Create A Star Using Python Turtle

 

 

Source Code:

 

import turtle
screen = turtle. Screen ()
screen.setup (500, 600, startx=0, starty=100)
t = turtle.Turtle()
s = turtle.Screen ()
s.bgcolor("black")
t.speed (10)
color = ['green', 'yellow','blue','cyan']
c = 0
for i in range(80):
    t.forward(i*7)
    t.right(144)
    t.color(color[c])
    if c==3:
        c = 0
    else:
        c+=1

 

Output:

 

Create A Star Using Python and Turtle

Leave a Reply

Your email address will not be published. Required fields are marked *