Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Apparently you need to sort an associative array by key using these functions?
There are no associative arrays in python, there are dictionaries (dict) and keys are not sorted in them.
You can sort arrays (list) using the sort()
method my_list.sort(key=lambda x: x==1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question