Python sort 🗄️

Pubblicato il: 18 gennaio 2021
sul canale di: Bro Code
22,366
1.1k

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...  
===========================================================


In questa pagina del sito puoi guardare il video online Python sort 🗄️ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 18 gennaio 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 22,366 volte e gli è piaciuto 1.1 mille spettatori. Buona visione!