1 00:00:00,000 --> 00:00:05,000 And here are the exercises for the level 4 of this course. 2 00:00:05,001 --> 00:00:08,000 So I'm going to give you here two exercises. 3 00:00:08,001 --> 00:00:13,000 The first one, you're going to compute the Max value 4 00:00:13,001 --> 00:00:15,000 inside a list of numbers that you read from a file. 5 00:00:15,001 --> 00:00:20,000 So the thing is that computing the Max value from a list of numbers, 6 00:00:20,001 --> 00:00:24,000 you actually have done that before and you have a function for that. 7 00:00:24,001 --> 00:00:27,000 So what you can do is you can use the function you have 8 00:00:27,001 --> 00:00:31,000 created before and actually put it inside a Python module. 9 00:00:31,001 --> 00:00:34,000 Okay, so we already have the my computations module. 10 00:00:34,001 --> 00:00:38,000 You can put this function in that module and then use it in your code. 11 00:00:38,001 --> 00:00:42,000 And also one thing to pay attention to is the data 12 00:00:42,001 --> 00:00:44,000 type you are going to get when you read from a file. 13 00:00:44,001 --> 00:00:47,000 This is a string, so make sure to cast it accordingly. 14 00:00:47,001 --> 00:00:53,000 And the second exercise is to read a list of cities from a file, 15 00:00:53,001 --> 00:00:57,000 order them alphabetically and write them to another file. 16 00:00:57,001 --> 00:01:00,000 So here you can download the city list, okay, 17 00:01:00,001 --> 00:01:02,000 as an additional resource of the course. 18 00:01:02,001 --> 00:01:06,000 So download the list, put it somewhere in your computer 19 00:01:06,001 --> 00:01:09,000 and then use either the relative or the absolute path. 20 00:01:09,001 --> 00:01:14,000 What I'm going to do is simply to put the file in the same directory 21 00:01:14,001 --> 00:01:18,000 as the Python file I'm going to write the code into. 22 00:01:18,001 --> 00:01:22,000 And to sort the list alphabetically, well, you don't need to invent, 23 00:01:22,001 --> 00:01:29,000 well, you don't need to invent a complex algorithm or write a lot of lines of code. 24 00:01:29,001 --> 00:01:32,000 You can simply use the built-in sorted function 25 00:01:32,001 --> 00:01:36,000 which simply takes one parameter which is the list you want to sort. 26 00:01:36,001 --> 00:01:39,000 And this is going to return the sorted list. 27 00:01:39,001 --> 00:01:42,000 All right, so take the time to do the exercises. 28 00:01:42,001 --> 00:01:46,000 If needed, come back to the previous lessons and watch them again. 29 00:01:46,001 --> 00:01:49,000 And then I will see you in the next lesson for the solution.