Blog Post

By me

Back

Python For Loops

In Python, a for loop is used to iterate over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). Here's the basic syntax for a for loop:

for x in range(10):
    print(x)