python3 for range code example
Example 1: range python 3
arr = [19,5,3,22,13]
for i in range(len(arr)):
print(arr[i])
for i in range(2, len(arr)):
print(arr[i])
for i in range(0, len(arr), 2):
print(arr[i])
for i in range(len(arr)-1, -1, -1):
print(arr[i])
Example 2: Range python iterate by 2
for i in range(0,10,2):
print(i)
Example 3: range py
range(start, stop, step)
x = range(0,6)
for n in x:
print(n)
>0
>1
>2
>3
>4
>5
Example 4: in range python
for i in range(x)
Example 5: for i in range python
for elt in Liste:
print(elt)
Example 6: for i in range python
times_repeated = 10
for i in range(1, times_repeated + 1):
print(i)