N
N
Nubbin2018-03-05 13:18:36
Python
Nubbin, 2018-03-05 13:18:36

Does python have a uasort method?

Hello guys, this is a question.
I can't find if there are features like (uasort, ksort) in python?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan Krapivin, 2018-03-05
@xevin

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 question

Ask a Question

731 491 924 answers to any question