0% found this document useful (0 votes)
15 views

Python Star

Uploaded by

Jozu the Great
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Python Star

Uploaded by

Jozu the Great
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import turtle

import time

star = turtle.Turtle() #t = turtle.Turtle()


star.pen(pencolor="blue", pensize=5, speed=3) #t.pen
bg = turtle.Screen() #background
bg.bgcolor("light green") #t.bgcolor("green")
star.shape("arrow") #t.shape("star") >> only shapes available
# square, arrow, circle,
# turtle, triangle, classic
fw = 50
for x in range(10):
for i in range(5):
star.forward(fw)
star.right(144)

fw = fw + 20
star.hideturtle() #hides turtle(or any other shape)
star.up() #pull up pen (no drawing unless after using pen.down)
star.clear() #clear all turtle drawing
time.sleep(2) #delay time (in seconds)
star.pendown() #puts down pen

You might also like