''' Purpose: another take on nested looping example from today. This version makes use of a special feature print() Also starts counting from 1. Example run Enter number: 4 1 1 2 1 2 3 1 2 3 4 ''' import pause reply = input( 'Enter number: ' ) n = int( reply ) # iterate i from 1 to n for i in range( 1, n + 1 ) : # iterate i from 1 to n for j in range( 1, i + 1 ) : # iterate j from 1 to i # for now let's print the current i, j combination print( 'i =', i, ' j =', j ) print() pause.enter_when_ready() print( "another nested loop") # iterate i from 1 to n for i in range( 1, n + 1 ): # iterate i from 1 to n for j in range( 1, i + 1 ): # iterate j from 1 to i # for now let's print the current i, j combination print( j, end=' ' ) print( )