Python sort sorting tutorial example explained
#python #sorting #sort
-------------------------------------------------------------------
sort() method = used with lists
sort() function = used with iterables
students = (("Squidward", "F", 60),
("Sandy", "A", 33),
("Patrick","D", 36),
("Spongebob","B", 20),
("Mr.Krabs","C", 78))
grade = lambda grades:grades[1]
students.sort(key=age) # sorts current list
sorted_students = sorted(students,key=grade) # sorts and creates a new list
for i in sorted_students:
print(i)
-------------------------------------------------------------------
music credits 🎼 :
===========================================================
Up In My Jam (All Of A Sudden) by - Kubbi / kubbi
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
Free Download / Stream: http://bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A Sudden) – Kubb...
===========================================================
En esta página del sitio puede ver el video en línea Python sort 🗄️ de Duración hora minuto segunda en buena calidad , que subió el usuario Bro Code 18 enero 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 22,366 veces y le gustó 1.1 mil a los espectadores. Disfruta viendo!