Answers for "python for loop step"

3

python for loop jump by 2

for i in range(0,10,2):
  print(i)
Posted by: Guest on November-01-2020
1

how to print a number at the end of a for loop in python

for i in range(1,4):
  if i == 3:
    print(i)
Posted by: Guest on October-06-2020
0

python for loop with step

for i in xrange(0,10,2):
  print(i)
Posted by: Guest on March-09-2021
2

Range python iterate by 2

for i in range(0,10,2):
  print(i)
Posted by: Guest on May-20-2020
0

steps in for loop python

list_1 = [9, 5, 7, 2, 5, 3, 8, 14, 6, 11]

for i in range(0, len(list_1), 2) :
    print(list_1[i])
    
2 is the steps
output:
9
7
5
8
6
Posted by: Guest on August-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language