Hello and welcome everybody to this lecture.
Our coast master baseline for Data Analysis follow lobbying through and Interpol executes a block of
code repeatedly until the condition is a full statement is no longer valid and trouble.
And based on fears to anything that can be viewed over such as a string list of GOP scientists for lobbying
slow and hateful.
As for eye in Interpol print I examine colors equal red yellow green blue black or color in colors print
colors.
First we declare as a list for colors and the games members red yellow green blue black makes the statement
for color and colors.
Those are program loops zeros the colors the left hand assigns each member and the list choose a variable
color the first time the program runs throws the loop it assign red to variable colors the statement
to grant the colors then Prentiss the value of red the second time the program loops through four statement
it assigns the value yellow to colors and Grant is a value yellow.
The program continues moving through the list until the end of the list is that each issue runs a program.
You will get red yellow green blue black.
The index of the members in the list can be displayed by the use of enumerate function for index color
and enumerate colors.
Column Brent index and the colors zero red one yellow to green the loop for flag looping through a sequence
of numbers.
Example blue throw as ring that an edgy equal high for I in m as G.
Brent I H I.
You will get H and I loops through a sequence of numbers Z built in range function comes in handy the
range function generates a list of numbers and has assigned text range start in step f start is not
given the numbers generated will start from zero not a useful step 4 to remember here is that in Python
and most programming language unless otherwise stated We always start from zero branch function f just
start is not given the numbers generated that start from zero f step is not given a list of consecutive
numbers were generated.
Example step equals 1 the end value must be provided however one weird thing about the range function
is that's a given and the value is never part of the generated list for instance range of 5 will generate
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
generate 4 6 8 The range function what inside a false statement examined for i in range is 3 brain I
0 1 2 4 index it ranges re print index 0 1 2 break using break in for loop sometimes we want to stop
the loop hole and meet specific 17 condition so we use that break example a equal 0 for index in range
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
Riggs accuser will move from ICU to i 10 because we use the function range then however with the break
K will the program end this bereavement usually at I to this is because when I equal to a which is the
value of 6 and the break cable causes them to end we use continue to skip specific step ends iteration
versus exemption for numb range 3 if num equal 1 continue but into got onto number and no value result
current no equal zero guarantee no equal to then zero will stop
we will get red yellow green blue left for index and the color and enumerate colors Brent and index
and colors we will get zero red one yellow to green three blue for black then we will drive message
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
I in range five Brent I will get zero.
One two three four four I am ranges three and did not end eight Brent I.
We will get three four five six seven eight nine four.
I arrange for and ten and two.
Brent I.
We will get
four six eight.
Eight equal zeal for I am ranged in age plus two.
Brent I and I value and value is equal for break.
We will get I equals 0 8 equal to equal one equal is in 0 Williston
4 I arrange 10 Brent I and I value.
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
current number and the name value current number equal 0 current number equal to 4 num ranges read Brent
current number and name value we will get current to number 0 current the number one current number
2.
Thank you for watching.
See you next lecture.