# Python tupletut.py ... rudimentary Python tuple tutorial print "Define our tuple myt this way ..." print "myt = 76, 12345, 54321, 'hello world!', 5, 'wow, tuples are interesting'" myt = 76, 12345, 54321, 'hello world!', 5, 'wow, tuples are interesting' print " " print "What would be the first element of myt? ..." print "print myt[0]" print myt[0]; print " " print "What does the whole tuple myt look like? ..." print "print myt" print myt; print " " print "How do I find out what 12345 + 54321 equals? ..." print "print (myt[1] + myt[2])" print (myt[1] + myt[2]); print " " print "Let's unpack tuple myt to x1, x2, x3, x4, x5, x6 equals? ..." print "x1, x2, x3, x4, x5, x6 = myt # please note no-no example is x1, x2, x3 = myt" x1, x2, x3, x4, x5, x6 = myt; print " " print "So what do each of x1, x2, x3, x4, x5, x6 equate to now? ..." print "print x1" print x1 print "print x2" print x2 print "print x3" print x3 print "print x4" print x4 print "print x5" print x5 print "print x6" print x6; print " " print "Let's base another tuple myu on previous tuple myt? ..." print "myu = myt, (1, 2, 3, 4, 5)" myu = myt, (1, 2, 3, 4, 5);print " " print "What does the whole tuple myu look like? ..." print "print myu" print myu; print " " print "What does it mean to add together the first & second elements of tuple myu? ..." print "print (myu[1] + myu[2])" print (myu[0] + myu[1]) exit()