Answers for "how to run a loop from 1 to n in python"

7

loops in python

#While Loop:
while ("condition that if true the loop continues"):
  #Do whatever you want here
else: #If the while loop reaches the end do the things inside here
  #Do whatever you want here

#For Loop:
for x in range("how many times you want to run"):
  #Do whatever you want here
Posted by: Guest on September-24-2020
2

Range python iterate by 2

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

Code answers related to "how to run a loop from 1 to n in python"

Python Answers by Framework

Browse Popular Code Answers by Language