# File Tuple01.py # Rev 7/31/00 # Copyright 2000, R. G. Baldwin # Illustrates indexing and # slicing a simple tuple # #------------------------------- print "Create a simple tuple" aTuple = \ (3.14,59,"A string",1024) print "Print index value 2" print aTuple[2] print "Print a short slice" print aTuple[0:3] print "Print the entire tuple" print aTuple[:100] Figure 7 |