1 00:00:00,510 --> 00:00:03,570 Hello and welcome everybody to this lecture. 2 00:00:03,600 --> 00:00:11,250 Our coast master baseline for Data Analysis follow lobbying through and Interpol executes a block of 3 00:00:11,250 --> 00:00:19,360 code repeatedly until the condition is a full statement is no longer valid and trouble. 4 00:00:19,440 --> 00:00:30,940 And based on fears to anything that can be viewed over such as a string list of GOP scientists for lobbying 5 00:00:30,940 --> 00:00:32,560 slow and hateful. 6 00:00:32,620 --> 00:00:42,610 As for eye in Interpol print I examine colors equal red yellow green blue black or color in colors print 7 00:00:42,610 --> 00:00:43,140 colors. 8 00:00:43,150 --> 00:00:53,110 First we declare as a list for colors and the games members red yellow green blue black makes the statement 9 00:00:53,110 --> 00:00:55,080 for color and colors. 10 00:00:55,090 --> 00:01:02,440 Those are program loops zeros the colors the left hand assigns each member and the list choose a variable 11 00:01:02,440 --> 00:01:11,150 color the first time the program runs throws the loop it assign red to variable colors the statement 12 00:01:11,150 --> 00:01:20,050 to grant the colors then Prentiss the value of red the second time the program loops through four statement 13 00:01:20,410 --> 00:01:27,160 it assigns the value yellow to colors and Grant is a value yellow. 14 00:01:27,360 --> 00:01:34,560 The program continues moving through the list until the end of the list is that each issue runs a program. 15 00:01:34,570 --> 00:01:38,960 You will get red yellow green blue black. 16 00:01:39,390 --> 00:01:46,510 The index of the members in the list can be displayed by the use of enumerate function for index color 17 00:01:46,540 --> 00:01:48,230 and enumerate colors. 18 00:01:48,280 --> 00:01:58,810 Column Brent index and the colors zero red one yellow to green the loop for flag looping through a sequence 19 00:01:58,810 --> 00:01:59,810 of numbers. 20 00:01:59,830 --> 00:02:09,250 Example blue throw as ring that an edgy equal high for I in m as G. 21 00:02:09,370 --> 00:02:12,220 Brent I H I. 22 00:02:12,220 --> 00:02:23,800 You will get H and I loops through a sequence of numbers Z built in range function comes in handy the 23 00:02:24,110 --> 00:02:32,950 range function generates a list of numbers and has assigned text range start in step f start is not 24 00:02:32,950 --> 00:02:41,320 given the numbers generated will start from zero not a useful step 4 to remember here is that in Python 25 00:02:41,410 --> 00:02:50,630 and most programming language unless otherwise stated We always start from zero branch function f just 26 00:02:50,630 --> 00:02:59,890 start is not given the numbers generated that start from zero f step is not given a list of consecutive 27 00:03:00,310 --> 00:03:02,410 numbers were generated. 28 00:03:02,410 --> 00:03:12,570 Example step equals 1 the end value must be provided however one weird thing about the range function 29 00:03:12,690 --> 00:03:20,960 is that's a given and the value is never part of the generated list for instance range of 5 will generate 30 00:03:21,000 --> 00:03:37,050 the list 0 1 2 3 4 4 I and rent 3 and then call on Brent I will generate 3 4 5 6 7 8 9 range 4 9 2 will 31 00:03:37,050 --> 00:03:49,140 generate 4 6 8 The range function what inside a false statement examined for i in range is 3 brain I 32 00:03:49,830 --> 00:04:02,940 0 1 2 4 index it ranges re print index 0 1 2 break using break in for loop sometimes we want to stop 33 00:04:03,030 --> 00:04:14,040 the loop hole and meet specific 17 condition so we use that break example a equal 0 for index in range 34 00:04:14,660 --> 00:04:32,210 then hey plus to brain high equal and I a equal and a if a equal for break I 0 a 2 1 a 4 was I was that 35 00:04:32,260 --> 00:04:41,390 Riggs accuser will move from ICU to i 10 because we use the function range then however with the break 36 00:04:41,680 --> 00:04:51,420 K will the program end this bereavement usually at I to this is because when I equal to a which is the 37 00:04:51,420 --> 00:05:00,820 value of 6 and the break cable causes them to end we use continue to skip specific step ends iteration 38 00:05:00,870 --> 00:05:14,660 versus exemption for numb range 3 if num equal 1 continue but into got onto number and no value result 39 00:05:14,830 --> 00:05:20,500 current no equal zero guarantee no equal to then zero will stop 40 00:05:32,050 --> 00:05:40,540 we will get red yellow green blue left for index and the color and enumerate colors Brent and index 41 00:05:40,630 --> 00:05:49,550 and colors we will get zero red one yellow to green three blue for black then we will drive message 42 00:05:49,770 --> 00:06:03,310 m as G equal high between two double quotes for I in m as we go along Brent I we will get H and I for 43 00:06:03,310 --> 00:06:06,880 I in range five Brent I will get zero. 44 00:06:07,030 --> 00:06:13,550 One two three four four I am ranges three and did not end eight Brent I. 45 00:06:13,600 --> 00:06:19,700 We will get three four five six seven eight nine four. 46 00:06:19,700 --> 00:06:23,720 I arrange for and ten and two. 47 00:06:23,900 --> 00:06:25,150 Brent I. 48 00:06:25,500 --> 00:06:26,450 We will get 49 00:06:30,540 --> 00:06:32,070 four six eight. 50 00:06:34,940 --> 00:06:40,890 Eight equal zeal for I am ranged in age plus two. 51 00:06:40,930 --> 00:06:47,050 Brent I and I value and value is equal for break. 52 00:06:47,740 --> 00:06:55,480 We will get I equals 0 8 equal to equal one equal is in 0 Williston 53 00:07:00,580 --> 00:07:04,780 4 I arrange 10 Brent I and I value. 54 00:07:05,770 --> 00:07:17,740 We will get I from ICE 0 2 I equal 9 for num in range of 3 column if num equal 1 column continue Brent 55 00:07:17,770 --> 00:07:26,800 current number and the name value current number equal 0 current number equal to 4 num ranges read Brent 56 00:07:27,010 --> 00:07:34,540 current number and name value we will get current to number 0 current the number one current number 57 00:07:34,540 --> 00:07:35,620 2. 58 00:07:35,680 --> 00:07:37,880 Thank you for watching. 59 00:07:37,900 --> 00:07:39,420 See you next lecture.