Python for loops are used to iterate over a finite series, such as a str, list, tuple, dict or other form of collection.
For loops will never result in an infinite loop!
The iterable in this case could be any collection. Note that, as with all python structures indentation is extremely important.
There are examples of using the for loop on some of the collections pages. The name given to the var should be a good descriptive name, so while terms like i, j and n are sometimes used, we should pick variable names that describe the object(s) we are iterating over.
Another way to do it is with the range function, which is often used alongside the len function to get the length of the collection. This is sometimes necessary if we have a use for the index of the items we are looping over.
A nested for loop is simply a loop inside a loop.
the range builtin function
This builtin function is known as a generator.
It can be helpful to "see" what it looks like, and we can do this by getting it to generate a sequence we can "see" in a list.
>>> print(list(range(5)))
[0, 1, 2, 3, 4]
This also works if you use start, stop and step, but lets you "see" what the result will be. If you want to know what color underpants the range function uses, and who their daddy is, you can check out this realpython article on range.