customerAges = [13, 3, 11, 24, 35, 25, 15, 18, 1]
maximum = customerAges[0]
for item in customerAges:
if(item>=int(maximum)):
maximum=item
else:
continue
print("Maximum value:",maximum)
If you assign the item value to the maximum value without compare them, then you should get the input which is 1. Because in the for loop, the program just putting the item value at current index to the maximum value whether it's equal or greater than the current maximum value. In the end of the loop, maximum variable's value will be 1. (Last index of the list)