/* */

Wednesday, 23 March 2011

Access tuple elements

x = 1,2,3
x[1]
2 → indexing is the same procedure as lists
x[0:2]
(1,2) → again same as lists, index items from 0 up to 2 (excluding 2)

  • Tuples can be used as keys when mapping.

No comments:

Post a Comment