Last Updated: January 3, 2026
31 quizzes
Complete the statement so total_price stores the product of quantity and unit_price.
total_price = quantity unit_priceClick an option to fill the blank:
Complete the statement so user_age is converted from text input to an integer number.
user_age = int()Click an option to fill the blank:
Complete the statement so the length of the message string is stored in msg_length.
msg_length = (message)Click an option to fill the blank:
Which of the following is a valid variable name in Python?
Which data type is best for storing a user's full name?
What is the type of the value 3.0 in Python?
Which expression performs integer (floor) division in Python?
What is the result type of 5 + 2.5 in Python?
What does the input() function return by default?
Which of these lines is a valid single-line comment in Python?
What happens if you write code inside an if statement without indenting it?
Which of the following is a Python keyword?
Which identifier follows Python naming conventions for a variable storing a user's email?
Which operator checks if two values are not equal?
Order the steps to read an integer age from the user and store it in age_years.
Drag and drop to reorder, or use the arrows.
Order the steps to calculate and display the area of a rectangle using variables.
Drag and drop to reorder, or use the arrows.
What is the output of this code?
1length = 4
2width = 2
3area = length * width
4print(area)What is the output of this code?
1value = 7
2print(type(value) == int)What is the output of this code?
1a = 5
2b = 2
3result = a // b + a % b
4print(result)What is the output of this code?
1text = "5"
2number = 3
3combined = text * number
4print(combined)What is the output of this code?
1x = 0.1 + 0.2
2rounded = round(x, 1)
3print(rounded)Find the bug in this code that reads an age and prints it in 10 years.
Click on the line(s) that contain the bug.
age_text = input("Enter your age: ")age_number = age_textfuture_age = age_number + 10print(f"In 10 years you will be {future_age}")Find the bug in this code that calculates the average of two numbers.
Click on the line(s) that contain the bug.
first_number = 10second_number = 20sum_numbers = first_number + second_numberaverage = sum_numbers / 0print(average)Match each numeric type with a suitable example value.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match each concept with its description.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Complete the code to read a product price from the user as a float and print it with a label.
price_text = input("Enter product price: ")price_number = (price_text)print("Price:", )Click an option to fill blank 1:
Complete the code to calculate the total number of items from two integer variables and display it.
box_count = 3items_per_box = 4total_items = box_count items_per_boxprint()Click an option to fill blank 1:
Complete the code so that a comment explains the calculation and the result of a+b is printed.
This line adds two numbersa = 5b = 7(a + b)Click an option to fill blank 1:
Complete the code so that status is True when score is at least 50 and it is printed.
score = 65status = score 50print()Click an option to fill blank 1:
Click the line that will raise an error because of an invalid identifier.
Click on the line to select.
user-name = "alex"print(user-name)Click the line that causes a runtime error.
Click on the line to select.
items = []first_item = items[0]print(first_item)