WEBVTT

00:00.000 --> 00:08.320
Exploring a key concept in programming loops you'll understand what is a loop

00:08.320 --> 00:19.440
types of loops creating loop through lists what is a loop a loop in Python

00:19.440 --> 00:23.600
allows you to repeat the same set of instructions multiple times without

00:23.600 --> 00:32.080
writing them again example friends equal to lily jack max here we have a list

00:32.080 --> 00:36.200
of friends names we can use a loop to print each name individually print and

00:36.200 --> 00:44.600
run the code type the following code for friend and friends print friend click run

00:44.600 --> 00:50.720
to see the results you'll see each name displayed on a separate line

00:50.720 --> 00:56.480
types of loops there are two types of loops in Python while loop for loop but

00:56.480 --> 01:00.800
we will focus on the for loop this loop is perfect for repeating a task for

01:00.800 --> 01:06.560
each item in a list allowing you to go through each item one by one example

01:06.560 --> 01:14.080
friends equal to lily jack max we want to send a message to each friend

01:14.080 --> 01:19.400
without typing separate lines for each one type the following code for friend

01:19.400 --> 01:28.200
and friends print high plus friend plus exclamation mark note the plus sign is

01:28.200 --> 01:36.000
used to combine strings remember to add a space before and after high click run

01:36.000 --> 01:41.000
to see the results you'll see the messages printed for each friend we

01:41.000 --> 01:46.320
learned about loops in Python especially the for loop to practice you can

01:46.320 --> 01:53.320
create a shopping list and a list of animals keep trying new things with loops

