''' Purpose: introduce nested looping. for a user-supplied n, loop n times, where on the ith iteration the integers from 0 to i are printed out. ''' import time # get n reply = input( 'Enter number: ' ) n = int( reply ) # performed the repeated printing of a number series for i in range( 0, n ) : # HOW MANY ROWS I WANT # print a line of the form # row i: 0 1 2 ... i print( "Row", i) for j in range( 0, i + 1 ): # FILLING IN EACH ROW (FOR EACH ROW DO THIS) print ( " j=", j, end=" ") print() # to do so need to first print the row i: part # then on same line print out the values 0 1 2 ... i one after the other # Nested For Loops: # The inner loop must execute for one iteration of the # outer loop before it goes to the next outer loop iteration