Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Turtle Lab # 1 General Directions Turtle graphics comes with your Python compiler and is a graphical way to learn programming. In order to work
Turtle Lab #
General Directions
Turtle graphics comes with your Python compiler and is a graphical way to learn programming. In order to work with Turtle graphics you need to import the turtle library. From there you can make the turtle move on your screen. If you have not done so already, please read the material listed on Canvas that describes Turtle Graphics.
In this lab you will learn how to use the turtle class and its methods. You will utilize some basic commands in order to get your turtle to move on the screen. The end product is a short program, containing functions that will allow you to move the turtle.
The methods listed below are a part of the turtle class. They will allow you to move the turtle, draw shapes and add color.
tableMethodDatatypeshowturtleShows the turtle on the screenforwardAllows the turtle to move pixelsrightTurns the turtle right degrees leftTurns the turtle left degreessetheadingSets the turtle's heading to a degreesheadingReturns the turtle's headingpenupAllows you to move the turtle without drawing a linependownAllows you to move the turtle with the pen down.circleradiusDraws a circle with a specific radius.dotDraws a simple dotpensizewidthAllows you to change the width of the pen in pixels.pencolorcolorAllows you to change the color of the pen.bgcolorcolortableAllows you to change the background color of the turtle's graphicswindowclearErases all drawings. Does not reset anything.resettableErases all drawings that currently appear in the graphics window,resets the drawing color to black, resets the location of the turtle tothe middle of the screen and resets the background color.clearscreentableErases all drawings that currently appear in the graphics window,resets the drawing color to black, resets the graphics windowbackground color to white and resets the turtle to its original positionin the center of the screen.setupwidth height Specifies the size for the graphics windowgoto Moves the turtle to a specifc postion on the screen.Returns the turtle's position on the screen.Returns the turtles coordinate position on the screenycorReturns the turtles y coordinate position on the screen.speedspeedAllows you to set the speed of the turtle from to hideturtleHides the turtlewriteDisplays text in the graphics window.beginfillFills a shape. Use this before you draw the shape.endfillEnds filling a shapefillcolorcolorFills a shape with a colordoneAllows the graphics window to stay open after the program has run.shapetableAllows you to specify a shape for the turtle. For instance,turtleshapeturtle allows your cursor to turn in to a turtle. Othershapes include: "arrow", "circle", "square", "triangle", andclassic
Drawing Shapes
For your portion of the lab you will create a circle, square and a shape of your choosing. Initialize the turtle shape to be a turtle and the color to be green.
Create a circle that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be
Size needs to be pixels
Drawn at
Change the turtle back to green
Create a Square that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be
Size needs to be pixels. This means that when you make
Create a Square that contains the following:
Fill color of your choosing
Pen Color in a contrasting color
Pen Size needs to be
Size needs to be pixels. This means that when you make the turtle go forward it needs to go forward pixels.
Drawn at
Change the turtle back to green
Create a shape of your choosing that is not a circle or square. You can draw a triangle, parallelagram, rectangle, etc. This shape needs to be different from the other shapes already drawn in the program in terms of location, fill color, pen color and size. Your file and pen color need to be different from your other shapes. The pen size also needs to be different from your other shapes.
Change the turtle back to green
Relocate the turtle to or the center of the screen.
Finished Drawing
My rendition of a circle, square and different shape looked like the following. Your output will be different since you are choosing different colors and your last shape will be different.
Handing In
Once your program is working upload your py file to Canvas.
Assignment Rubric
tableExemplary,ptsCompetent,ptsDeveloping,ptsDid not completeComments in the code,Only one comment in code,Comments are sparse,No commentstableCreated a circle in the rightlocation with the right size,contained a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started