0 votes
1 view
in Python by (11.8k 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 (24.6k 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.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...