
Snack Shop Debugging Quiz
Authored by Nada Ali
Information Technology (IT)
8th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is wrong with this line of code? snacks = ["popcorn", "soda" "chocolate"]
Nothing is wrong
Missing a comma between "soda" and "chocolate"
Python doesn’t allow lists with 3 items
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why does this code cause an error? print("Available snacks are: " + snacks)
The list must be printed separately
The variable snacks is undefined
You can’t use print on lists
3.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which line of code prints the snacks list without error?
print("Available snacks are:", snacks)
print(f"Available snacks are: {snacks}")
Both a and b
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you print the snacks like this: Available snacks are: popcorn, soda, chocolate
print("Available snacks are: " + snacks)
print(f"Available snacks are: {snacks}")
print("Available snacks are: " + str(snacks))
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why is this an error? popcorn = "30"
30 is too high for a price
It is stored as a string, not an integer
Python doesn’t allow numbers
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What data type does input() always return in Python?
int
str
float
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do we correctly ask the user for a number of popcorns?
popcorn_qty = input("How many popcorns? ")
popcorn_qty = int(input("How many popcorns? "))
int = input("How many popcorns? ")
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?