in range python code example
Example 1: range in python
for x in range(0,20,2):
print(x)
Example 2: python range
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 3: python range
for i in range(0, 4):
print(i)
>0
>1
>2
>3
for i in range(4):
print(i)
>0
>1
>2
>3
for i in range(0, 4, 2):
print(i)
>0
>2
Example 4: in range python
for i in range(x) :
Example 5: range in python
for i in range (start, step, stop):
dosomething()
Example 6: in range python
for i in range(x)