QUESTION IMAGE
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
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:
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
if item > maximum: