Loops

Loops in Python

Python supports for and while loops for iteration.

Code Examples
# For loop\nfor i in range(5):\n    print(i)\n\n# While loop\ncount = 0\nwhile count < 5:\n    print(count)\n    count += 1