-2

list = [3,5,1,8,9] I want to find positions of the maximum value in the list

Amal das
  • 13
  • 1

1 Answers1

1

This is pretty simple, but it will give you the index of the first occurrence:

>>> l = [3,5,1,8,9]
>>> l.index(max(l))
4

I strongly suggest you not use the name of built-in functions as list for variables.

lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228