・ Range (n) is an integer sequence from 0 to n-1. ・ Range (n, m) is an integer sequence from n to m-1 ・ Range (n, m, k) is the tolerance p from n to m-1
for i in range(10):
print(i)
0
1
2
3
4
5
6
7
8
9
Values from 1 to 9 are assigned to i.
for i in range(4,10):
print(i)
4
5
6
7
8
9
Values from 4 to 9 are assigned to i.
for i in range(4,10,2):
print(i)
4
6
8
Substitute 2 for i with a value from 4 to 9.
Recommended Posts