Making tables using lists of lists and tuples of tuples. : loop through « Tuple « Python Tutorial






table1 = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
table2 = ( ( 1, 2 ), ( 3, ), ( 4, 5, 6 ) )

print "Values in table1 by row are"

for row in table1:
   for item in row:
      print item,
   print

print "\nValues in table2 by row are"

for row in table2:
   for item in row:
      print item,
   print








6.7.loop through
6.7.1.Making tables using lists of lists and tuples of tuples.
6.7.2.sorted(), reversed(), enumerate(), zip()