What symbol is used to assign a value to a variable?
=
What numeric data type represents a whole number with no decimals?
int (or Integer)
Which loop is best used when you want a block of code to repeat infinitely as long as a condition remains true?
while loop
What keyword is used to create or define a brand new function?
def
What built-in function displays text outputs directly to the console screen (AKA the terminal or shell)?
print()
True or False: 3_score is a valid Python variable name.
False (Variable names cannot start with a number)
What data type represents text data, always wrapped in quotes?
str (or String)
What statement is used inside a loop to immediately exit it completely?
break
What keyword does a function use to send a value back to the code that called it?
return
What function pauses the program to collect text data typed in by the user?
input()
If x = 5, what will x equal after you run the line
x = x + 2
?
7
What data type can only hold one of two values: True or False?
bool (or Boolean)
What mathematical symbol is used to check if two values are exactly equal to each other in an if statement?
== (double equals)
When defining a function like
def greet(name):
what do we call the variable name inside the parentheses?
a parameter (or argument)
What character must you place at the very end of an if, for, or def line before indenting the code below it?
a colon ( : )
True or False: The variable names Score and score are treated as the same variable by Python.
False (Python is case-sensitive)
What data type represents numbers with decimal points, like 3.14?
float
What block is placed at the very end of an if and elif chain to handle any cases that didn't match?
else
True or False: Code written inside a function will run automatically the moment the script is executed, even if you don't call the function.
False (Functions only run when they are explicitly called)
The input() function always captures data as what specific data type, even if the user types a number?
A string (str)
What type of error will Python throw if you try to use a variable name that you haven't created yet?
NameError
What Python function can you use to check what data type a variable currently holds?
type()
How many times will a loop run if it starts with
for i in range(5):
?
Bonus: What will i be in each loop?
5 times (It counts 0,1,2,3,4)
If a function doesn't have a return statement, what special value does it automatically give back when called?
None
What is the term for combining two strings together using the + operator, like "cat" + "dog"?
Concatenation