Skip to content

Understanding Tuples and identifying use cases #3

@space-otter

Description

@space-otter

Build up a good understanding for tuples as a data structure and find use cases where it shines.

Tuples

Definition: Ordered, immutable, allows duplicates.

Syntax: my_tuple = (1, 2, 3)

Common operations & properties:

  • Indexing: my_tuple[1]
  • Unpacking: a, b, c = my_tuple
  • Count: my_tuple.count(2)
  • Index: my_tuple.index(3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions