Python ProgrammingPython Programming

How to find the index of the maximum value of a list in Python?

thelist = [5, 9, 4, 9, 7, 2, 8]

print(thelist.index(max(thelist)))
Output
1