|
Oktatás * Programozás 2 * Szkriptnyelvek * Adator. prog. Teaching * Prog. for Data Sci. Félévek Linkek * kalendárium |
EnPy3 /
20121006eAdvanced sortingExercise 1 Consider the following records (list of tuples):
data = [
(1,'Albany','NY',162692),
(121,'Wyoming','NY',8722),
(3,'Allegany','NY',11986),
(123,'Yates','NY',5094)
]
Sort the records by the value of the last column. Exercise 2 Consider the following list:
Sort the list by user ID in descending order:
100:User3
80:User2
75:User4
45:User5
10:User1
00:User4
Exercise 3 Consider the following matrix:
Sort the rows of the matrix by the 2nd column: [ [1, 3], [5, 4], [2, 6] ] |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |