QP School
range() function in Python 3 - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: Python 3 Tutorials and examples (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=51)
+--- Thread: range() function in Python 3 (/showthread.php?tid=5062)



range() function in Python 3 - Qomplainerz - 07-25-2023

# 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