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

Import Turtle

The document defines several functions that use the turtle module to draw different shapes and objects. It draws the letters "P", "A", "N", "G", "1", "00", and "4", as well as a star, sun, and crescent moon. The functions are then called to render the complete image on a dark blue background.

Uploaded by

api-327713634
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)
74 views3 pages

Import Turtle

The document defines several functions that use the turtle module to draw different shapes and objects. It draws the letters "P", "A", "N", "G", "1", "00", and "4", as well as a star, sun, and crescent moon. The functions are then called to render the complete image on a dark blue background.

Uploaded by

api-327713634
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
You are on page 1/ 3

import turtle

turtle.bgcolor("#0c0d2b")
turtle.shape("turtle")
turtle.speed(0)
turtle.color("gold")
turtle.width(9)

turtle.penup()
turtle.goto(-280,40)

def drawP():
turtle.color("#fffac6")
turtle.pendown()
turtle.left(90)
turtle.forward(100)
for index in range(4):
turtle.forward(100)
turtle.right(90)
drawP()

turtle.penup()
turtle.right(90)
turtle.forward(130)
turtle.right(90)
turtle.forward(100)
turtle.right(180)

def drawA():
turtle.color("#ffccf6")
turtle.pendown()
turtle.forward(200)
turtle.right(90)
turtle.forward(80)
turtle.right(90)
turtle.forward(200)
turtle.penup()
turtle.goto(-150,140)
turtle.pendown()
turtle.left(90)
turtle.forward(80)
turtle.penup()
turtle.forward(32)
turtle.right(90)
turtle.forward(100)
turtle.right(180)
drawA()
def drawN():
turtle.color("#cdeef7")
turtle.pendown()
turtle.forward(200)
turtle.right(160)
turtle.forward(213)
turtle.left(160)
turtle.forward(200)
turtle.right(90)
drawN()

turtle.penup()
turtle.forward(110)

def drawG():
turtle.color("#cdf7d9")
turtle.pendown()
turtle.right(180)
turtle.forward(80)
turtle.left(90)
turtle.forward(200)
turtle.left(90)
turtle.forward(80)
turtle.left(90)
turtle.forward(80)
turtle.left(90)
turtle.forward(35)
drawG()

def draw1():
turtle.color("#79b2a4")
turtle.penup()
turtle.goto(-110,10)
turtle.pendown()
turtle.left(90)
turtle.forward(80)
draw1()

def draw00():
turtle.color("#fffd91")
turtle.penup()
turtle.goto(-5,-30)
turtle.pendown()
turtle.begin_fill()
for index in range(90):
turtle.right(5)
turtle.forward(3)
turtle.end_fill()
turtle.penup()
turtle.goto(30,-62)
turtle.pendown()
turtle.begin_fill()
for index in range(90):
turtle.right(5)
turtle.forward(3)
turtle.end_fill()
draw00()

def draw4():
turtle.color("#79b2a4")
turtle.penup()
turtle.goto(100,-5)
turtle.right(180)
turtle.pendown()
turtle.forward(45)
turtle.left(90)
turtle.forward(45)
turtle.left(90)
turtle.forward(45)
turtle.left(180)
turtle.forward(80)
draw4()

def star():
turtle.color("#fff956")
turtle.penup()
turtle.goto(210,-140)
turtle.pendown()
turtle.width(4)
for index in range(20):
turtle.left(210)
turtle.right(79)
turtle.forward(70)
star()

def sun():
turtle.color("#ffd84f")
turtle.penup()
turtle.goto(0,-190)
turtle.pendown()
turtle.width(10)
turtle.begin_fill()
for index in range(20):
turtle.left(40)
turtle.right(60)
turtle.forward(85)
turtle.end_fill()
sun()

def drawmoon():
turtle.penup()
turtle.goto(-250, -195)
turtle.pendown()
turtle.left(190)

for index in range(40):


turtle.right(6)
turtle.forward(6)
turtle.left(135)
for index in range(40):
turtle.left(7)
turtle.forward(11)
drawmoon()
turtle.done()

You might also like