How do you create a variable named age with the value 25?
age = 25
What is the symbol used to assign a value to a variable?
=
What is the term for data that can be changed in Python?
Variable
What keyword is used to start a loop that repeats a block of code a certain number of times?
What keyword do you use to define a function?
def
How do you create a variable 'name' that holds the text "Alice"?
name = "Alice"
How do you print a message to the console?
print('message')
What is the term for a value that does not change?
Constant
How do you write a loop that runs 5 times?
for i in range(5)
When naming a function will the name be case sensitive? T or F
T
What symbol(s) is used to perform an exponent?
**
What function is used to get user input as text?
input()
What do you call a sequence of characters like "hello"?
string
What is the output of
for i in range(3):
print(i)
0 1 2
How do you call a function defined as
def main():
main()
What data type(s) is used for numbers in Python?
float and int
What will the output be when the following code runs:
print(5+'5')
TypeError
What is the term for a block of code that performs a specific task?
Function
What is the FINAL output of
for i in range(3):
print(i*i)?
4
What will be the output of the function
def say_hello():
print("Hello")
say_hello()
"Hello"
What is the data type of the value "hello"?
string
What symbol(s) are used to make a comment
# or """
What is the area of the IED called that shows feedback from your code?
Terminal or Console
What keyword is used to stop a loop?
break
How do you call a function named my_function?
my_function()