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
Course Navigation
Getting Started with Python
Operators and Expressions
Data Structures - Lists and Tuples
Data Structures - Dictionaries and Sets
Control Flow