- ArcPy and ArcGIS(Second Edition)
- Silas Toms Dara O'Beirne
- 77字
- 2025-04-04 19:02:02
Tuples
Tuples are cousins to lists, and are denoted by parentheses (). Unlike lists, tuples are "immutable". No data can be added or removed, nor can they cannot be adjusted or extended, once a tuple has been created in memory (it can be overwritten). Data within a tuple is referenced in the same way as a list, using index references starting at 0 passed to square brackets []:
>>> atuple = ('e','d','k')
>>> atuple[0]
'e'