QP School

Full Version: range() function in Python 3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
# In Python 3, range() returns a range object that generates numbers on-the-fly
numbers = range(5)
for num in numbers:
    print(num)  # Output: 0, 1, 2, 3, 4