What symbol is used to start a comment in Python?
What is hastag?
What are the only two possible values for a Boolean in Python?
What is True and False
What index does Python start counting from in a list?
What is 0
This loop is used for definite iteration, when you know exactly how many times to repeat code.
What is a for loop?
This is a block of code that runs only when it is called, and it can accept parameters and return values.
What is a function?
What are the three main types of numbers and text data in Python covered in this lesson?
What are Integers, Floats, and Strings
Which conditional structure handles multiple conditions in sequence?
What is if, elif, and else
Given tools = ["Saw", "Hammer", "File", "Mallet", "Lever", "Wrench"], what does tools[2:5] return?
What is ["File", "Mallet", "Lever"]
This loop is used when you don’t know how many times you’ll need to repeat code, and it continues while a condition is true.
What is a while loop?
This is the reason why programmers use functions repeatedly instead of copying code multiple times.
What is to reduce repetition and write more efficient code?
What Python operator returns the remainder of a division operation?
What is modulus
What will this condition evaluate to:
True or False and not False?
What is True
(Because not False = True, and False and True = False, so True or False = True)
What does tools[-3:] return from the list, tools = ["Saw", "Hammer", "File", "Mallet", "Lever", "Wrench"] ?
What is ["Mallet", "Lever", "Wrench"]
This keyword inside a loop skips the rest of the current loop iteration and jumps to the next one.
What is continue?
This term refers to where a function is created using the def keyword.
What is a function definition?
What would be the output of print("Dory says: \n\t\"Just keep swimming!\"")?
(Make to describe what the code output would look like)
What is Dory says:
"Just keep swimming!"
What type of error occurs when you try to use a variable that hasn’t been defined?
What is NameError
What would the output of people_info[1][1] be, given the list people_info = [["Miranda", 14], ["Ethan", 19], ["Christ", 23], ["Tyler", 6]]?
What is 19
This happens when the stopping condition for a while loop is never met.
What is an infinite loops?
If a function has parameters and returns a value, this is how you must structure the code when calling it.
What is by matching parameters in the call and using a print statement or variable to handle the return?
What will the variable counter contain after this code runs?
counter = 2
counter *= 15
counter -= 10
counter /= 2
What is counter = 10.0
What is the purpose of a try/except block in Python?
What is to catch and handle exceptions without crashing the program.
How could you slice a list to get everything except the last two elements?
What is list[:-2]
This compact syntax can generate a list using a single line that combines a loop and optional condition.
What is list comprehension?
This term describes the act of using the function name to execute the function’s code.
What is a function call?