What symbol assigns a value to a variable?
=
What keyword defines a function?
def
What keyword loads modules or libraries?
import
What keyword adds an alternative condition after if?
elif
What method adds an item to the end of a list?
.append()
What type is "1701"?
String
What is pseudocode?
A roadmap/checklist for what to do in plain words
What keyword renames a module?
as (e.g. import pandas as pd)
What keyword stops a loop immediately?
break
What method removes the last key-value pair in a dictionary?
What type results from 1701 + 1.0?
Float
What keyword in a custom function makes the output reusable?
return
What does random.randint(1,10) do?
Generates a random integer between 1 and 10 (inclusive)
What keyword skips one iteration?
continue
How do you access the value for key "apples" in {"apples": 2}?
the_dict_name["apples"]
Which function checks a variable’s data type?
type()
What is the purpose of using parameters in a function?
Work as placeholders to pass data into a function
What’s the difference between a module and a library in Python?
A module is one python file with functions; a library is a collection of modules
What keyword means “run this code only if all prior conditions are false”?
else
What makes a tuple different from a list?
Tuples are immutable/unchangable
What error happens with 1701 + "1701"?
TypeError
What happens if you call a function before defining it?
Python throws a NameError
Why do we use modules/libraries?
To save time by using pre-written functions/tools
What is the main difference between for and while loops?
for runs fixed times; while runs until a condition is False
What’s the purpose of try/except?
Addressing an error without your program crashing/stopping