
CH05 - If Statements (part 3)
Authored by Ramsey Seweingyawma
Computers
9th - 12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
OPEN ENDED QUESTION
3 mins • 10 pts
Explain the difference between an if-elif-else chain and a series of independent if statements. When would you use one over the other? Provide an example for each.
Evaluate responses using AI:
OFF
2.
OPEN ENDED QUESTION
3 mins • 10 pts
The document states that when a list is used in an if statement, an empty list evaluates to False. Why is this a useful feature when dealing with user-provided input?
Evaluate responses using AI:
OFF
3.
OPEN ENDED QUESTION
3 mins • 10 pts
What is the purpose of checking if a list is not empty before running a for loop? What could happen if you don't perform this check?
Evaluate responses using AI:
OFF
4.
OPEN ENDED QUESTION
3 mins • 10 pts
Describe how you would use a loop and an if statement together to process each item in a list and handle one or more "special" items differently.
Evaluate responses using AI:
OFF
5.
OPEN ENDED QUESTION
3 mins • 10 pts
Pizza Topping Order: A pizzeria has a list of toppings they have in stock and a customer places an order with a list of requested toppings. Describe how you would write a program that loops through the customer's request and prints a message for each topping, indicating whether it has been added to the pizza or if it is unavailable.
Evaluate responses using AI:
OFF
6.
OPEN ENDED QUESTION
3 mins • 10 pts
Shopping Cart Validation: An e-commerce website has a list of items a user has placed in their shopping cart. Before processing the order, you need to verify that none of the items are from a list of banned_items. Describe how you would use an if statement with the not in keyword and a for loop to check each item in the shopping cart and print a message if a banned item is found.
Evaluate responses using AI:
OFF
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?
Similar Resources on Wayground
10 questions
Activity 1: How well do you know Java?
Quiz
•
9th Grade
10 questions
Evaluación Final UNDECIMO 11
Quiz
•
11th Grade
10 questions
XI_осн_веб_кон
Quiz
•
9th - 12th Grade
10 questions
Abhyudaya coding class - Grade 7
Quiz
•
6th Grade - University
10 questions
MIL March 8, 2023
Quiz
•
12th Grade
10 questions
NHTW Programming
Quiz
•
9th Grade
9 questions
Test Excel
Quiz
•
10th - 12th Grade
10 questions
Câu hỏi trắc nghiệm Tin Học 10 - Bài 10
Quiz
•
10th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
14 questions
[AP CSP] JavaScript Programming Quiz
Quiz
•
9th - 12th Grade
10 questions
Understanding Computers and Computer Engineering
Interactive video
•
7th - 12th Grade
37 questions
Python - Tuples, Lists, and List Methods
Quiz
•
9th - 12th Grade
60 questions
MOS Word Home, Insert, Reference Ribbon Basics
Quiz
•
9th Grade