Friday, June 22, 2012

Tuples in jython


Tuples

Tuples are non modifiable object arrays parsed with an index.
A tuple is handled as a series of values separated by commas and within brackets.
·         () is an empty tuple
·         (0,1,2,3) is a 4 elements tuple, indexed from 0 to 3
·         tuple = (0, (1, 2), (4,5,6)) is a tuple that contains other tuples. tuple[1][0] returns 1

Operations on sequences are available for the tuples.

No comments:

Post a Comment