Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
EnPy /
20121006eAdvanced sortingExercise 1 Consider the following records (list of tuples): data= [ (001,'Albany','NY',162692), (003,'Allegany','NY',11986), (121,'Wyoming','NY',8722), (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 ] |