I have a list a = [5, 1, 2, 3, 4, 5]
My program should return a list of the "indexes" of the maximum value, in this case [0, 5]
but I'm using enumerate and not the actual index.
a = [5, 1, 2, 3, 4, 5]
a2 = enumerate(a)
result = list(a2)
print(result)
This now gives me [(0, 5), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]
but I'm unsure of how to return 0 and 5 from here. I can find them individually by trying
print(result[0][0])
print(result[5][0])
but having trouble iterating over the list of tuples to find the first element where the second element is the maximum value. I'm thinking I need to use the max function but again unsure of the syntax this should take.