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 find the maximum age of a customer. what is the missing line of code? customerages = 13, 3, 11, 24, 35, 25, 15, 18, 1 maximum = customerages0 for item in customerages: maximum = item

Explanation:

Step1: Initialize maximum

Set the first element as initial max.

Step2: Compare elements

Need to compare each element with current max to update it. The missing line should be a conditional statement to check if the current item is greater than the current maximum. So the missing line is if item > maximum:

Answer:

if item > maximum: