0% found this document useful (0 votes)
8 views3 pages

Turtle Graphics: Drawing Letters and Shapes

This document uses the turtle module in Python to draw various shapes and letters. It first sets up the turtle by configuring its shape, width, color, speed, and background color. It then draws the letter W. Next it draws the letter I in blue, then the letter N in yellow. It draws the numerals 1 and 0 in orange and light green. Finally, it draws a yellow filled star in red.

Uploaded by

api-350627931
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Turtle Graphics: Drawing Letters and Shapes

This document uses the turtle module in Python to draw various shapes and letters. It first sets up the turtle by configuring its shape, width, color, speed, and background color. It then draws the letter W. Next it draws the letter I in blue, then the letter N in yellow. It draws the numerals 1 and 0 in orange and light green. Finally, it draws a yellow filled star in red.

Uploaded by

api-350627931
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import turtle

#setup
[Link]("turtle")
[Link](1)
[Link]("green")
[Link](100)
[Link]("black")
[Link]()
[Link](180)
[Link](300)
[Link](90)
[Link](150)
[Link](90)
[Link]()

#draw letter W

def drawW():
for index in range(1, 50):
[Link](20)
[Link](75)
[Link](1)
[Link](105)
[Link](20)
[Link](105)
[Link](1)
[Link](75)
for index in range(1, 39):
[Link](20)
[Link](75)
[Link](1)
[Link](105)
[Link](20)
[Link](105)
[Link](1)
[Link](75)
[Link](20)
for index in range(1, 39):
[Link](75)
[Link](1)
[Link](105)
[Link](20)
[Link](105)
[Link](1)
[Link](75)
[Link](20)
for index in range(1, 50):
[Link](75)
[Link](1)
[Link](105)
[Link](20)
[Link](105)
[Link](1)
[Link](75)
[Link](20)

drawW()

#setup for letter I


[Link]()
[Link](50)
[Link]("Blue")
[Link]()
[Link](90)
[Link](10)

import math

def drawI():
[Link](([Link](3) + 1) * (100 / (2 * [Link](2))))

drawI()

#setup for letter N


[Link]()
[Link](90)
[Link](50)
[Link]("yellow")

def drawN():
[Link]()
[Link](90)
[Link](([Link](3) + 1) * (100 / (2 * [Link](2))))
[Link](150)
[Link]((2 * ([Link](3) + 1) * (100 / (2 * [Link](2)))) /
[Link](3))
[Link](150)
[Link](([Link](3) + 1) * (100 / (2 * [Link](2))))

drawN()

[Link]()
[Link](-200, -60)

#setup for numer 1


[Link]()
[Link]("orange")
[Link](180)

drawI()

#setup for 0
[Link]()
[Link](90)
[Link](50)
[Link](90)
[Link]()

def draw0():
turtle.begin_fill()
[Link](([Link](3) + 1) * (100 / (2 * [Link](2))))
[Link](90)
[Link](50)
[Link](90)
[Link](([Link](3) + 1) * (100 / (2 * [Link](2))))
[Link](90)
[Link](50)
[Link]("lightgreen")
turtle.end_fill()

draw0()

[Link]()
[Link](180)
[Link](100)
[Link]()
[Link]("orange")
[Link](90)

draw0()

[Link]()
[Link](180)
[Link](100)
[Link]("orange")
[Link](90)
[Link]()

drawI()

[Link]()
[Link](200, -100)
[Link](2)
[Link]("red")
[Link]()

def drawstar():
turtle.begin_fill()
for index in range(8):
[Link](150)
[Link](157.5)
[Link](150)
[Link](157.5)
[Link]("yellow")
turtle.end_fill()

drawstar()

[Link]()

You might also like