#-------------------------------------------------------------------------------
#  NestedLoop.py
#  Print out a multiplication table.
#-------------------------------------------------------------------------------

N = 10
# print multiplication table 1-N using for loops

# print top row
print()
print('\t', end='')
for j in range(1,N+1): 
   print(j, end='\t')
# end for
print()

# print table boundary
print('    ', end='')
for j in range(1,N+1): 
   print('--------', end='')
# end for
print()

# print left column and body of table
for i in range(1,N+1):
   print(i, end='\t')
   for j in range(1,N+1): 
      print(i*j, end='\t')
   # end for
   print()
# end for
print()
print()


# print multiplication table 1-N using while loops

# print top row
print()
print('\t', end='')
j=1
while j<N+1: # same as j<=N
   print(j, end='\t')
   j += 1  # same as j = j+1
# end while
print()

# print table boundary
print('    ', end='')
j=1
while j<N+1:
   print('--------', end='')
   j += 1
# end while
print()

# print left column and body of table
i=1
while i<N+1:
   print(i, end='\t')
   j=1
   while j<N+1:
      print(i*j, end='\t')
      j += 1
   # end while
   print()
   i += 1
# end while
print()
print()
   
