Tuples: Constructing Tuples
Concatenation
Syntax: tuple1 + tuple2
E.g.
>>> t = (1,2) + (3,)
>>> t
(1, 2, 3)
Repetition
Syntax: tuple * integer
E.g.
>>> t * 5
(1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3)
Previous slide
Next slide
Back to first slide
View graphic version