Horje
sort python nested list according to a value Code Example
sort python nested list according to a value
name_age = [["A", 7], ["B", 5], ["C", 35]]
name_age.sort(key=lambda age: age[1])
#name_age.sort(key=lambda age: age[1], reverse = True)
print(name_age)

#sorts according to the 1th value of the inner loop




Python

Related
divide by zero errors when using annotate Code Example divide by zero errors when using annotate Code Example
AttributeError: ‘numpy.ndarray’ object has no attribute ‘append’ Code Example AttributeError: ‘numpy.ndarray’ object has no attribute ‘append’ Code Example
case statement in querset django Code Example case statement in querset django Code Example
read bytes from file python Code Example read bytes from file python Code Example
get most repeated instance in a queryset django Code Example get most repeated instance in a queryset django Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7