WEBVTT

00:00.050 --> 00:05.060
In this activity, I will give you a challenge which will make you practice everything you've seen until

00:05.060 --> 00:05.600
now.

00:05.630 --> 00:06.440
Variables.

00:06.440 --> 00:07.310
Functions.

00:07.310 --> 00:07.850
Scope.

00:07.850 --> 00:08.510
Conditions.

00:08.510 --> 00:10.400
Loops and lists.

00:10.430 --> 00:12.110
Here is what you have to do.

00:12.140 --> 00:18.170
You have to create a program that will go through a list of integer numbers, and will compute the maximum

00:18.170 --> 00:20.030
value inside the array.

00:20.030 --> 00:22.250
And then you print this max value.

00:22.280 --> 00:22.490
Okay.

00:22.520 --> 00:26.630
And some of you might know already that there is a function that does that in Python.

00:26.630 --> 00:28.700
So we don't need to write this code at all.

00:28.700 --> 00:31.400
But the goal is to practice on the concepts.

00:31.430 --> 00:31.580
Okay.

00:31.610 --> 00:33.140
That's why I give you this challenge.

00:33.140 --> 00:36.920
So I'm just going to start here to give you a few tips.

00:36.920 --> 00:38.630
And then you can practice.

00:38.690 --> 00:43.400
You will create a list for example number list like this is equal to.

00:43.430 --> 00:45.320
And let's put some values.

00:45.350 --> 00:45.680
Okay.

00:45.710 --> 00:52.040
So for example one and then five -612 and seven.

00:52.070 --> 00:52.250
Okay.

00:52.280 --> 00:53.240
So five values.

00:53.240 --> 00:55.010
Just choose any values you want.

00:55.040 --> 00:58.370
It doesn't really matter then to be able to compute the max value.

00:58.400 --> 01:02.000
We are going to actually create a variable named max value.

01:02.000 --> 01:06.110
And you can see if you just write Max, there is syntax highlighting here.

01:06.110 --> 01:11.840
So if you see this okay, if you want to create a variable and you see that the name turns purple like

01:11.840 --> 01:13.340
that or another color.

01:13.370 --> 01:17.810
Don't use that because it's probably a reserved keyword or a function.

01:17.810 --> 01:21.500
So for example here we use max value.

01:21.770 --> 01:24.320
We're just going to create a variable and we initialize it.

01:24.320 --> 01:26.510
So you could use zero to initialize it.

01:26.510 --> 01:29.600
But we're just going to initialize it to the first element.

01:29.600 --> 01:35.120
So number list zero we initialize it to the first element of the list.

01:35.120 --> 01:38.480
And then well then it's your turn to practice.

01:38.480 --> 01:39.470
That's the challenge.

01:39.470 --> 01:44.870
What you will have to do is well, you will have to go through all of the elements of the list and then

01:44.870 --> 01:46.970
find a way to keep the max value.

01:47.000 --> 01:47.180
Okay.

01:47.180 --> 01:51.440
When you find a max value, you keep it and at the end you print it, okay.

01:51.440 --> 01:52.310
And that's the first step.

01:52.310 --> 01:54.710
So you write the code to compute the max value.

01:54.740 --> 01:55.700
You print it.

01:55.700 --> 02:00.140
Then as a second step you can create a function just for that functionality.

02:00.140 --> 02:03.410
So then you can call the function from your main program okay.

02:03.440 --> 02:06.530
And I will see you in the next video for the solution.
