Documentation Index
Fetch the complete documentation index at: https://preview.bazel.build/llms.txt
Use this file to discover all available pages before exploring further.
The built-in tuple type. Example tuple expressions:
Accessing elements is possible using indexing (starts from 0):
Lists support the + operator to concatenate two tuples. Example:
x = (1, 2) + (3, 4) # x == (1, 2, 3, 4)
x = ("a", "b")
x += ("c",) # x == ("a", "b", "c")
Similar to lists, tuples support slice operations:
('a', 'b', 'c', 'd')[1:3] # ('b', 'c')
('a', 'b', 'c', 'd')[::2] # ('a', 'c')
('a', 'b', 'c', 'd')[3:0:-1] # ('d', 'c', 'b')
Tuples are immutable, therefore x[1] = "a" is not supported.