ranking in python

Solutions on MaxInterview for ranking in python by the best coders in the world

showing results for - "ranking in python"
Clea
22 Jul 2020
1def rank_giver(Numbers):
2    first = 0
3    second = 0
4    third = 0
5    for num in Numbers:
6        if num > third:
7          third = num
8        if third > second:
9            temp = second
10            second = third
11            third = temp
12        if second > first:
13            temp = first
14            first = second                                           
15            second = temp
16            
17    return first,second,third
18
19print(rank_giver([10, 20, 50, 99]))