07-25-2023, 10:37 AM
# 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
numbers = range(5)
for num in numbers:
print(num) # Output: 0, 1, 2, 3, 4