Feb-12-2022, 09:19 PM
Hi.
I have a function that i use to rank a list from highest to lowest, right now it is hard coded to one list, what i would like to be able to do is pass lists to it.
I have a function that i use to rank a list from highest to lowest, right now it is hard coded to one list, what i would like to be able to do is pass lists to it.
def rank():
global mons
dict = {}
for i, e in enumerate(mons):
dict[e] = i
rank = 1
for key in sorted(dict.keys(), reverse=TRUE):
mons[dict.get(key)] = rank
rank = rank + 1
