Looping is about how you can repeat a block of statements until some condition is met. With a for loop, the mechanism for repeating a set of statements allows execution to continue until it exhausts all of your list’s data. List will be discussed later in this tutorial.
Will will cover sequence object (e.g list, tuples, dictionary) soon. But, let’s try the following sample code with a simple list:
for x in numbers:
The for loop will iterate every element in the list object (numbers) and print its value. It will stop when it reach the last element in the list. you can use the for loop to print all the element in the sting as well. Take a look of the following example:
for x in name