1 00:00:00,009 --> 00:00:06,340 So let's continue working with our lists. And I want us to try to write a program 2 00:00:06,710 --> 00:00:12,229 that will simply print out the high activity days. Now, what you see on my screen 3 00:00:12,350 --> 00:00:16,909 is a list of login attempts per day. 4 00:00:17,329 --> 00:00:19,549 So let us write a program 5 00:00:19,690 --> 00:00:23,299 that will go through this list and then print out 6 00:00:23,459 --> 00:00:26,250 the high activity days. 7 00:00:26,479 --> 00:00:27,549 However, 8 00:00:28,409 --> 00:00:31,690 to determine what a high activity would be, 9 00:00:31,770 --> 00:00:36,689 let's say login attempts that are 10 or more. 10 00:00:37,060 --> 00:00:37,659 OK? 11 00:00:37,759 --> 00:00:38,299 So 12 00:00:38,549 --> 00:00:39,610 to do this, 13 00:00:40,500 --> 00:00:47,009 let's create a variable that will store the high activity day. So I can say hi 14 00:00:47,860 --> 00:00:49,959 and then underscore activti 15 00:00:51,049 --> 00:00:52,240 underscore 16 00:00:52,490 --> 00:00:53,709 days. 17 00:00:54,470 --> 00:00:55,349 OK? 18 00:00:55,569 --> 00:00:58,169 Now this is going to be equal to 19 00:00:58,479 --> 00:01:00,520 let's say attempts, OK? 20 00:01:00,529 --> 00:01:05,569 We want to create a full loop that's going to go through the list. OK. So 21 00:01:05,889 --> 00:01:09,330 we have our brackets in here and then I can say attempt, 22 00:01:10,480 --> 00:01:11,180 OK? 23 00:01:11,349 --> 00:01:14,699 For, remember now, for attempt 24 00:01:15,650 --> 00:01:16,500 in 25 00:01:17,220 --> 00:01:18,519 where are we checking? 26 00:01:18,529 --> 00:01:21,919 The number of attempts is going to be in the login attempts list. So 27 00:01:22,180 --> 00:01:24,760 I'm gonna say in the login 28 00:01:25,599 --> 00:01:26,389 attempt 29 00:01:27,449 --> 00:01:33,449 and now we haven't talked about this yet. But you can also include an if statement 30 00:01:33,559 --> 00:01:37,050 directly inside of a for loop. So 31 00:01:37,230 --> 00:01:43,430 we want to create a loop that's going to go through a list and then if the attempt 32 00:01:43,769 --> 00:01:46,190 is 10 or more, 33 00:01:46,349 --> 00:01:52,150 we're gonna print out a high activity day. So attempt for attempt in login attempts. 34 00:01:52,500 --> 00:01:55,430 And now if what the attempts 35 00:01:56,739 --> 00:02:01,309 is greater than, or equal to 10, 36 00:02:02,110 --> 00:02:02,889 you got that. 37 00:02:03,000 --> 00:02:03,660 Ok. 38 00:02:03,849 --> 00:02:05,970 So now what should happen? 39 00:02:06,209 --> 00:02:07,769 Let's simply print 40 00:02:08,710 --> 00:02:09,899 and then in brackets, 41 00:02:10,240 --> 00:02:12,250 we can say something like hi 42 00:02:12,860 --> 00:02:16,899 uh activity uh days, 43 00:02:17,139 --> 00:02:17,970 colon 44 00:02:18,449 --> 00:02:19,330 and then 45 00:02:19,460 --> 00:02:20,289 comma 46 00:02:20,500 --> 00:02:21,490 high 47 00:02:21,839 --> 00:02:24,619 underscore activity days. 48 00:02:24,820 --> 00:02:26,850 So now if I run the program 49 00:02:27,820 --> 00:02:35,330 and there you go, the high activity activity days, we have 1012, 15 and 20. 50 00:02:35,820 --> 00:02:39,679 So this is how we can run a full loop to 51 00:02:39,690 --> 00:02:44,100 go through our list and then print or do something else. 52 00:02:44,380 --> 00:02:48,910 So I'm going to provide you with an exercise, a challenge in the very next video. 53 00:02:48,919 --> 00:02:49,880 Please go through it 54 00:02:50,149 --> 00:02:53,199 and attempt to answer the questions. 55 00:02:53,300 --> 00:02:57,119 Thank you for watching the video. I will see you in the next class.