QUESTION IMAGE
Question
a restaurant recorded the ages of customers on two separate days. you are going to write a program to compare the number of customers in their twenties (ages 20 to 29). what is the missing line of code to count the number of customers in their twenties? customerages = 13, 3, 11, 24, 35, 25, 15, 18, 1 count20s = 0 if 20 <= item <= 29: count20s = count20s + 1
Step1: Iterate through list
We need to loop through the customerAges list to check each age. In Python, a for loop can be used for this. The general syntax for iterating over a list is for item in list_name:. Here, list_name is customerAges.
for item in customerAges:
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
for item in customerAges: