Basic Types (Tuples)Tuplesf = (2,3,4,5) # A tuple of integers g = (1,) # A 1 element tuple h = (2, [3,4], (10,11,12)) # A tuple containing mixed objects Tuple Manipulationx = f[1] # Element access. x = 3 y = f[1:3] # Slices. y = (3,4) z = h[1][1] # Nesting. z = 4 Comments
|
<<< | O'Reilly OSCON 2000, Advanced Python Programming, Slide 12 July 17, 2000, beazley@cs.uchicago.edu |
>>> |