Answers for "loop back through a for loop in python"

3

python loop back to start

def main(): #defines the area in indents that will be triggered with main()#
  print('hi')
  yn = input('Wanna loop back to the start? ')
  if yn = 'yes':
    main() #loops back to where we defined main#
    
main() #This starts the main loop, without this, main would just be defined but not run#
Posted by: Guest on August-09-2020
0

run a for loop in python

for x in range(6):
  print(x)
Posted by: Guest on August-12-2021

Code answers related to "loop back through a for loop in python"

Python Answers by Framework

Browse Popular Code Answers by Language