Files
Learn-Python-Programming-Th…/ch03/range.py
T
adii1823 8b802c5c62 ch03
2021-10-28 17:34:45 +05:30

7 lines
254 B
Python

>>> list(range(10)) # one value: from 0 to value (excluded)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> list(range(3, 8)) # two values: from start to stop (excluded)
[3, 4, 5, 6, 7]
>>> list(range(-10, 10, 4)) # three values: step is added
[-10, -6, -2, 2, 6]