Tuples

 
#!/usr/bin/env python

t = 12345, 54321, 'hello!'  
print( t[0])                  # -> 12345
print( t)                     # -> (12345, 54321, 'hello!')
#
# tuples may be nested
#
u = t, (1, 2, 3, 4, 5)
print( u)                     # ((12345, 54321, 'hello!'), (1, 2, 3, 4, 5))

empty = ()
singleton = 'hallo', # note the trailing comma
print( singleton)             # -> ('hallo',)



Subsections