Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

a restaurant recorded the ages of customers on two separate days. you a…

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

Explanation:

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:

Answer:

for item in customerAges: