# File: ChapterControlFunc/loops.py # Enter the start, stop, and step values of the for-loop: # start? 1 # stop? 10 # step? 2 # output of for-loop: 1 3 5 7 9 # output of while-loop: 1 3 5 7 9 def main(): print("Enter the start, stop, and step values of the for-loop? ") start = int(input( "start? " )) stop = int(input( "stop? " )) step = int(input( "step? " )) print("output of for-loop: ",) for i in range( start, stop, step ): print(i,end='\t') print() # endl print("output of while-loop: ",) i = start while ( i < stop ): print(i, end='') # on the same line i = i + step print # endl main()