This Assignment Has Three Parts. Part One
This Assignment Has Three Parts. Part One
04 Creating Functions
Part One: Write a program to draw a picture by defining functions and using Turtle Graphics. Use the
following guidelines to write your program.
def Main()
Define function for rectangles (door, windows)
Define function for sun (loop, fill)
Make rectangle
Make sun
Main()
Part Two: Code the program. Use the following guidelines to code your program.
Example of expected output: The output for your program should resemble the following screen shot.
Your specific results will vary depending on the choices you make and the input provided.
#Daniel Romanov
#11/19/2020
#Use custom functions to draw a robot face
import turtle
f.penup()
f.setpos(0,0)
f.left(90)
f.pendown()
f.color("red")
f.begin_fill()
f.forward(250)
f.right(90)
f.forward(200)
f.right(90)
f.forward(250)
f.right(90)
f.forward(200)
f.right(90)
f.end_fill()
e.penup()
e.setpos(35,155)
e.left(0)
e.pendown()
e.color("blue")
e.begin_fill()
e.forward(60)
e.right(90)
e.forward(30)
e.right(90)
e.forward(60)
e.right(90)
e.forward(30)
e.right(90)
e.end_fill()
e.penup()
e.setpos(135,155)
e.left(0)
e.pendown()
e.color("blue")
e.begin_fill()
e.forward(60)
e.right(90)
e.forward(30)
e.right(90)
e.forward(60)
e.right(90)
e.forward(30)
e.right(90)
e.end_fill()
b.penup()
b.setpos(60,210)
b.left(0)
b.pendown()
b.color("black")
b.begin_fill()
b.forward(50)
b.right(90)
b.forward(20)
b.right(90)
b.forward(50)
b.right(90)
b.forward(20)
b.right(90)
b.end_fill()
b.penup()
b.setpos(160,210)
b.left(0)
b.pendown()
b.color("brown")
b.begin_fill()
b.forward(50)
b.right(90)
b.forward(20)
b.right(90)
b.forward(50)
b.right(90)
b.forward(20)
b.right(90)
b.end_fill()
n.penup()
n.setpos(80,100)
n.left(270)
n.pendown()
n.color("pink")
n.begin_fill()
n.forward(40)
n.right(-120)
n.forward(40)
n.right(-120)
n.forward(40)
n.right(-120)
n.end_fill()
m.penup()
m.setpos(35,60)
m.left(270)
m.pendown()
m.color("light blue")
m.begin_fill()
m.forward(40)
m.right(270)
m.forward(125)
m.right(270)
m.forward(40)
m.right(270)
m.forward(125)
m.right(270)
m.end_fill()
def main():
jeff = turtle.Turtle()
jeff.speed(1000)
face(jeff)
eyes(jeff)
nose(jeff)
mouth(jeff)
eyeballs(jeff)
How could your program be useful in the real This program can lead to popular digital art
world?
What is a problem you ran into and how did you fix I add an issue with adding many turtles, so I just
it? assigned all functions to one singular turtle
Describe one thing you would do differently the Definitely make an object that will need less code
next time you write a program. and by extension take less time to code.