Creating and accessing tuples. : Assign « Tuple « Python Tutorial






hour = 1
minute = 2
second = 3

currentTime = hour, minute, second   # create tuple

print "The value of currentTime is:", currentTime

print "The number of seconds since midnight is", \
   ( currentTime[ 0 ] * 3600 + currentTime[ 1 ] * 60 + currentTime[ 2 ] )








6.2.Assign
6.2.1.How to Create and Assign Tuples
6.2.2.How to Update Tuples
6.2.3.Creation, Repetition, Concatenation
6.2.4.joining their elements together
6.2.5.containing mutable objects that can be changed.
6.2.6.Creating and accessing tuples.
6.2.7.Unpacking sequences.