Assessment: Turtle Graphics

Assessment: Turtle Graphics >> Python Basics

turtle-11-1: What are correct ways to tell a turtle named Tex to move forward 20 pixels? Select as many as apply.






✔️Correct.
  1. This is a correct way to move a turtle forward.
  2. You are allowed to write expressions inside of methods, so this is correctly written.

turtle-11-2: Which is the correct way to make a new instance of the Turtle class?





✔️ Yes, this is the correct way.
 

 

turtle-11-3: What does each instance of the Turtle class represent?




✔️ Yes, an instance of the turtle class represents a unique turtle. The turtle class is like a stencil or mold that can be used to make as many turtles as you would like.
 
turtle-11-4: True or False, attributes/instance variables are just like other variables in Python.


✔️ Just like the variables you’ve learned about so far, you can assign values to an attribute and look up the values that are assigned to the attribute.
 

turtle-11-4: Select all of the following things that methods can do:






✔️Correct.
  1. Methods can change the value that is associated with an attribute.
  2. Methods can return values.
  3. Attributes do not need to be pre-declared; any code can add a new attribute to an instance just by assigning a value to it.

turtle-11-5: For an instance of a class that is assigned to the variable student, what is the proper way to refer to the title attribute/instance variable?






✔️ Yes, this is the correct syntax to use.
 

turtle-11-6: What is the name of jane’s attribute (not method) that is referred to in the following code?

import turtle

jane = turtle.Turtle()
jane.forward(20)
print(jane.x)

The attribute is


Good work!

turtle-11-7: What are the names of the instances in the following code? Please put one instance per blank space and enter them in the order that the computer would read them.

import turtle
wn = turtle.Screen()

jazz = turtle.Turtle()
jazz.forward(50)
jazz.right(90)
pop = turtle.Turtle()
pop.left(180)
pop.forward(76)


  • Good work!

  • Good work!

  • Good work!