for
for is used for looping. Generally we use for when we know the number of times we want to loop.
In Python we can use it with any type of sequence like a list or a string. Here is an example in which for is used to traverse through a list of names:
names = ['John','Monica','Steven','Robin']
for i in names:
print('Hello '+i)
Output
Hello John
Hello Monica
Hello Steven
Hello Robin