WEBVTT

1
00:00.000 --> 00:04.240
So friends, how did you get on now? I will say if this is the first time you're

2
00:04.240 --> 00:05.000
using Python

3
00:05.000 --> 00:06.560
This is quite a challenge

4
00:06.560 --> 00:10.200
So definitely do not beat yourself up if you found this really quite confusing

5
00:10.200 --> 00:13.340
So quite honestly even if you only got part of this challenge done

6
00:13.340 --> 00:16.790
Then that is really quite good if you got all of the challenge done then

7
00:16.790 --> 00:18.040
honestly I'm quite impressed

8
00:18.040 --> 00:21.740
So let's walk through the solution the very first thing that I want you to do

9
00:21.740 --> 00:24.240
is to create a list that is comprised of four elements

10
00:24.240 --> 00:29.720
OSPF EIGRP, BGP and RIP so let's go and do that then

11
00:29.720 --> 00:33.630
We go to this browser here. Let's open this up and what I will do is I will
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

11
00:29.720 --> 00:33.630
We go to this browser here. Let's open this up and what I will do is I will

12
00:33.630 --> 00:34.300
create my list now

13
00:34.300 --> 00:38.020
I can call the list to anything ISO wish just choose a variable name so long as

14
00:38.020 --> 00:40.420
we are following the conventions that we specified before

15
00:40.420 --> 00:41.600
So in my case here

16
00:41.600 --> 00:44.920
I will just choose to call this list routing protocols something nice and

17
00:44.920 --> 00:45.980
descriptive once again

18
00:45.980 --> 00:49.840
This is good practice now how do we actually create a list you remember?

19
00:49.840 --> 00:54.450
We're going to use square brackets and each element within the list is going to

20
00:54.450 --> 00:56.480
be separated by commas now each element

21
00:56.480 --> 00:59.740
It also has to be a string so we're going to make sure each element has

22
00:59.740 --> 01:00.840
quotation marks
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

22
00:59.740 --> 01:00.840
quotation marks

23
01:00.840 --> 01:06.770
So what was the first value? It was OSPF then EIGRP, BGP and RIP so also OSPF

24
01:06.770 --> 01:09.680
comma then EIGRP comma

25
01:09.680 --> 01:15.590
Then BGP comma and then finally RIP so if you manage this part then you were

26
01:15.590 --> 01:17.660
successfully able to create the first part of the challenge

27
01:17.660 --> 01:19.160
Now let's go to the next part

28
01:19.160 --> 01:23.720
We want to include a for loop to iterate through each element and

29
01:24.200 --> 01:27.880
Print it so I will use the for keyword now I can choose a variable name

30
01:27.880 --> 01:29.420
anything I also choose but again

31
01:29.420 --> 01:33.260
It does make sense to use one that is pretty descriptive so I don't want to say
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

31
01:29.420 --> 01:33.260
It does make sense to use one that is pretty descriptive so I don't want to say

32
01:33.260 --> 01:36.740
for pizza and routing protocols after all much more

33
01:36.740 --> 01:39.520
sensible instead to choose the name protocol

34
01:39.520 --> 01:44.140
So I will have my colon here and if I hit return we're going to indent within

35
01:44.140 --> 01:46.840
and all I will simply do now is to print out the

36
01:46.840 --> 01:49.280
Protocol variable that I'm looping through okay

37
01:49.280 --> 01:53.920
So if I go down here and I choose to run this give a moment as we can see here

38
01:53.920 --> 01:59.000
We are printing out each individual value here's OSPF EIGRP BGP and RIP the

39
01:59.000 --> 02:00.520
last portion of the challenge
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

39
01:59.000 --> 02:00.520
last portion of the challenge

40
02:00.520 --> 02:04.880
And that's probably the hardest bits is to modify the logic to include a single

41
02:04.880 --> 02:05.920
conditional check

42
02:05.920 --> 02:08.920
We want to check that if the string BGP is within the list

43
02:08.920 --> 02:12.200
We want to print at the statement that is an exterior gateway protocol

44
02:12.200 --> 02:12.680
available

45
02:12.680 --> 02:16.480
So let's try this then so scrolling on up as opposed to just printing this here

46
02:16.480 --> 02:20.430
Let's modify this and we'll run the check we'll say if the protocol we're

47
02:20.430 --> 02:22.480
looking through is equal to

48
02:22.480 --> 02:27.490
And we'll say BGP then I'll have my colon and then indented within I'm simply

49
02:27.490 --> 02:29.160
going to print out the statements

50
02:29.160 --> 02:33.120
There is an exterior gateway protocol available
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

50
02:29.160 --> 02:33.120
There is an exterior gateway protocol available

51
02:33.120 --> 02:36.760
So now if I get down and I run this here and look at it right here

52
02:36.760 --> 02:39.880
It says there is an exterior gateway protocol available

53
02:39.880 --> 02:42.960
So friends that is us for our validation challenge

54
02:42.960 --> 02:46.160
I hope it's been informative for you and I'd like to thank you for viewing
