1 00:00:06,230 --> 00:00:11,040 Congratulations. 2 00:00:11,040 --> 00:00:14,460 You've learned how to get Python to sort sequences for you. 3 00:00:14,460 --> 00:00:17,145 The sorted function handles all the details 4 00:00:17,145 --> 00:00:20,245 you just have to specify the desired sort order. 5 00:00:20,245 --> 00:00:24,590 You should now be able to invoke the sorted function to sort any sequence, 6 00:00:24,590 --> 00:00:28,925 you should be able to specify low to high or high to low sorting. 7 00:00:28,925 --> 00:00:32,900 Using the reverse parameter and you should be able to specify a property to 8 00:00:32,900 --> 00:00:38,845 sort by using a key function. It's joke time. 9 00:00:38,845 --> 00:00:42,740 I'm sure you've heard some rags to riches stories about the guy who started 10 00:00:42,740 --> 00:00:47,080 out working in the company mail room and eventually became the CEO. 11 00:00:47,080 --> 00:00:49,750 Well, this one has a little twist. 12 00:00:49,870 --> 00:00:52,880 It's Jerry's first day at the company and he's 13 00:00:52,880 --> 00:00:55,580 assigned to the mail room he's given the task sort 14 00:00:55,580 --> 00:00:58,220 the incoming mail and Jerry sorted 15 00:00:58,220 --> 00:01:02,240 the letters so fast that his motions were literally a blur, 16 00:01:02,240 --> 00:01:04,530 the supervisor was very impressed. 17 00:01:04,530 --> 00:01:07,870 At the end of the day, the supervisor approached Jerry and says, 18 00:01:07,870 --> 00:01:11,690 "I just want you to know that I'm very pleased with the job you did today, 19 00:01:11,690 --> 00:01:15,085 you're one of the fastest workers we've ever had." 20 00:01:15,085 --> 00:01:17,280 "Oh! Thank you sir, " said Jerry. " 21 00:01:17,280 --> 00:01:21,430 [inaudible] and tomorrow I'll try to do even better." 22 00:01:21,430 --> 00:01:24,955 Better how is that even possible? 23 00:01:24,955 --> 00:01:30,244 Jerry replied, "Tomorrow I'm going to read the addresses." 24 00:01:30,244 --> 00:01:35,520 We'll, see you next time when we sort dictionaries and learn how to break ties.