0% found this document useful (0 votes)
46 views1 page

Name Animoji

The document uses the turtle module in Python to draw a complex pattern using a turtle. It imports the turtle module, sets the background color, and defines a function called changeColor() that changes the turtle pen color. The main logic involves calling changeColor() repeatedly while moving the turtle in different directions and lengths to create the overall pattern before finishing and hiding the turtle.

Uploaded by

api-401083392
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)
46 views1 page

Name Animoji

The document uses the turtle module in Python to draw a complex pattern using a turtle. It imports the turtle module, sets the background color, and defines a function called changeColor() that changes the turtle pen color. The main logic involves calling changeColor() repeatedly while moving the turtle in different directions and lengths to create the overall pattern before finishing and hiding the turtle.

Uploaded by

api-401083392
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/ 1

turtle.

forward(1) for index in


range(10):
Name & Animoji turtle.penup() changeColor()
turtle.forward(45) turtle.left(90)
turtle.right(90) turtle.end_fill()
import turtle turtle.forward(150) turtle.penup()
turtle.pensize(3) turtle.forward(70)
turtle.bgcolor("#5b2a03 turtle.right(180) turtle.pendown()
") turtle.begin_fill()
def changeColor(): for index in range(2):
turtle.shape("turtle")
for index in
turtle.color("#993300")
turtle.color("#f2964f") range(5):
turtle.begin_fill()
turtle.forward(5) changeColor()
turtle.pensize(100)
turtle.speed("fastest") turtle.left(90)
turtle.color("#91592e") for index in
turtle.forward(5) range(10):
turtle.left(90)
changeColor()
turtle.forward(1)
turtle.pendown() turtle.left(90)
turtle.pensize(40)
for index in range(10): turtle.end_fill()
turtle.penup()
turtle.color("white") changeColor() turtle.penup()
turtle.left(90) turtle.forward(70)
turtle.pendown()
for index in range(4): turtle.left(90)
turtle.forward(1)
changeColor() turtle.pendown()
turtle.penup()
turtle.penup() for index in range(10):
turtle.pensize(20)
turtle.color("black") turtle.forward(20) changeColor()
turtle.left(90) turtle.color("#91592e")
turtle.pendown()
turtle.pendown() turtle.right(90)
turtle.forward(1)
for index in range(10): turtle.forward(170)
turtle.penup()
changeColor() turtle.right(90)
turtle.forward(50)
turtle.penup() turtle.forward(500)
turtle.right(90)
turtle.right(90) turtle.right(90)
turtle.pensize(40)
turtle.forward(20) turtle.forward(100)
turtle.forward(40)
turtle.color("#993300") turtle.right(90) turtle.right(90)
turtle.forward(100) turtle.forward(100)
turtle.pendown()
turtle.right(180) turtle.left(90)
turtle.forward(1)
turtle.pendown() turtle.forward(78)
turtle.right(180)
for index in range(10): turtle.penup()
turtle.penup()
changeColor() turtle.forward(280)
turtle.forward(81)
turtle.right(153.5) turtle.color("#f2964f")
turtle.pendown()
turtle.forward(111.8) turtle.pensize(80)
turtle.forward(1)
turtle.setheading(90) turtle.left(90)
turtle.right(180)
for index in range(10): turtle.forward(30)
turtle.penup()
changeColor() turtle.pendown()
turtle.forward(41)
turtle.forward(1)
turtle.right(90)
turtle.right(90) turtle.left(90)
turtle.forward(25)
turtle.color("#91592e") turtle.penup()
turtle.left(90)
turtle.forward(100) turtle.forward(407)
turtle.forward(20)
turtle.left(90) turtle.pendown()
turtle.pensize(20)
turtle.color("black") turtle.forward(100) turtle.forward(1)
turtle.right(90) turtle.hideturtle()
turtle.pendown()
turtle.forward(100)
turtle.forward(1)
turtle.right(90)
turtle.penup()
turtle.forward(500)
turtle.right(180)
turtle.right(90) turtle.done()
turtle.forward(41)
turtle.forward(180)
turtle.pendown()
turtle.right(90)
turtle.forward(1)
for index in range(10):
turtle.right(180)
changeColor()
turtle.penup()
turtle.left(90)
turtle.forward(21)
turtle.penup()
turtle.pensize(10)
turtle.color("white") turtle.forward(20)
turtle.pendown()
turtle.forward(20)
turtle.begin_fill()
turtle.pendown()
for index in range(2):
turtle.forward(1)
for index in
turtle.penup()
range(5):
turtle.right(180)
changeColor()
turtle.forward(41)
turtle.left(90)
turtle.pendown()

You might also like