```html
White background, black text. Type your answer, then press Check for each question.
Consider the following Python code:
x = 3
y = 4
z = x + y * 2
print(z)
What is the output?
What is the final value of total after this code runs?
total = 0
for i in range(1, 5):
total = total + i
Complete the condition so that the message is printed only when age is between 13 and 18 inclusive.
age = int(input("Enter age: "))
if ____________________:
print("Teenager")
Write the full condition to go inside the if (e.g. age > 0).
What is printed by this code?
nums = [2, 4, 6]
nums.append(8)
nums.pop(0)
print(nums)
What is the data type of the variable value after this line?
value = input("Enter a number: ")
Write a Boolean expression that is True only when score is between 0 and 100 inclusive.
Use score in your answer.
What does this function return when called as mystery(5)?
def mystery(n):
result = 1
for i in range(1, n + 1):
result = result * 2
return result
What is the final value of x after this code runs?
x = 10
while x > 3:
x = x - 2
A program runs without crashing, but the answer it prints is wrong because the formula is incorrect.
What type of error is this? (syntax, logic, or runtime)
Give one reason why a Python program might use functions (subprograms) instead of writing all the code in one long block.