color = "purple"
Answer: What is a variable?
What needs corrected? Which rule is being broken?
Answer: first name needs an underscore between them. What is snake_case naming?
This code is used for repeating actions of the Painter object, such as
bob.move ( )
bob.move ( )
bob.move ( )
bob.move ( )
Answer: What is a while loop.
Involves breaking down a problem into smaller, more manageable parts.
Answer: What is decomposition?
This is an action that an object can do.
Answer: What is a method?
What is the data type of this data value?
Answer: What is a string data?
# Create a painter
matt.painter
What are the 2 code errors?
Answer: What are Painter must be capitalized and it is missing parenthesis at the end.
Answer: What is
painter.turn_left( )
painter.turn_left( )
painter.turn_left( )
A problem-solving approach that involves breaking problems down into smaller parts, recognizing patterns, focusing on important details, and creating step-by-step solutions that a computer or person can follow.
Answer: What is Computational Thinking?
This is a character that has attributes (what it knows) and methods (what it can do).
Answer: What is an object?
What is the data type of 14?
Answer: What is an integer?
What 2 errors are present in the code below?
def secret_message( )
print("You're the best!)
Answer: The function is missing a colon : and the method must be indented [TAB].
Why won't the Painter object paint 4 spaces with the code below?
bob.move ( )
bob.take_paint( )
bob.paint("blue")
Answer: What is Bob the painter is only told to move, pick up paint, and paint 1 space.
This is the process of focusing on the important information and ignoring irrelevant details.
This is a way to plan out your code using plain language. Programmers use this to think through their ideas before writing real code.
Answer: What is pseudocode?
What is the data type of True?
Answer: What is a boolean data?
def turn_and_move( )
sue.turn_left( )
sally.move( )
Name the 2 errors in the code block above.
What type of code block is this?
Answer: Errors - What are a missing colon : and sue should be the name in both methods.
Type of code block: Function
How could you modify the code below to have Bob paint 4 spaces using a while loop?
bob.move ( )
bob.take_paint( )
bob.paint("blue")
Answer: What is
while bob.can_move( ):
bob.move ( )
bob.take_paint( )
bob.paint("blue")
A set of instructions to accomplish a task.
and
The popular programming language we have been practicing.
Answer: What are an algorithm and Python?
The actual data value you put into a function when you call or use it.
Answer: What is the argument?
while bob.can_move( ):
bob.move( )
bob.paint ( )
What is the type of code block used here?
Answer: What is a while loop?
if fred.can_move( )
fred.move(“north”)
else:
fred_paint(“green”)
What are the 2 errors & what type of code block is this?
Answer: What are missing a colon : and the underscore in the second method should be a period.
Type of code block: What is and if / else statement or a two-way selection statement
How could you modify the code below to have Bob paint 1 space when he can move and turn left when he cannot move?
bob.move ( )
bob.take_paint( )
bob.paint("blue")
Answer: what is
if bob.can_move( ):
bob.take_paint( )
bob.paint("blue")
else:
bob.turn_left ( )
These act as placeholders for the values (or arguments) that will be put into the function when it is called or used.
A .py file that contains Python code and can be used to save created functions for other projects.
Answer: What is a module?