Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sort array custom comparator

l = [{'prop': 2}, {'prop': 3}, {'prop': 1}]

l.sort(key=lambda x: x['prop'])
 
PREVIOUS NEXT
Tagged: #python #sort #array #custom #comparator
ADD COMMENT
Topic
Name
4+9 =