[PYTHON] range

for-range.py


"""
You can still output 0 to 9, but it's a hassle.
list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in list:
    print(i)
"""

#0 to 9 is output
for i in range(10):
    print(i)

#Output from 2 to 9 by skipping 3
for i in range(2, 10, 3):
    print(i)

Recommended Posts

range
range and xrange
double precision range
Character range / character string range
python> link> range () / xrange ()
Copying sutras using range
About Python, for ~ (range)