Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (16.4k points)

Consider the below list:

a = [32, 37, 28, 30, 37, 25, 27, 24, 35, 55, 23, 31, 55, 21, 40, 18, 50, 35, 41, 49, 37, 19, 40, 41, 31]

Here, the Highest element is 55

I want to discover in which position(s) the greatest value is arranged. Kindly, help.

1 Answer

0 votes
by (26.4k points)

Try the following code:

>>> m = max(a)

>>> [i for i, j in enumerate(a) if j == m]

[9, 12]

Join the python online course fast, to learn python concepts in detail and get certified.

For more details, do check out the below video tutorial...

Related questions

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 22, 2019 in Python by Sammy (47.6k points)

Browse Categories

...