About 139,000 results
Open links in new tab
  1. Mutable vs Immutable Objects in Python - GeeksforGeeks

    May 21, 2024 · The tuple itself isn’t mutable but contains items that are mutable. As a rule of thumb, generally, Primitive-like types are probably immutable, and Customized Container-like …

  2. Python's Mutable vs Immutable Types: What's the Difference?

    Jan 26, 2025 · Python has both mutable and immutable collection data types. Strings and tuples are immutable, while lists, dictionaries, and sets are mutable. This distinction is crucial for you …

  3. python - Why can tuples contain mutable items? - Stack Overflow

    Mar 13, 2021 · A tuple is immutable in the sense that the tuple itself can not expand or shrink, not that all the items contained themselves are immutable. Otherwise tuples are dull.

  4. Is Tuple Mutable or Immutable?

    Mar 13, 2023 · A: The main difference between a tuple and a list in Python is that a tuple is immutable, while a list is mutable. This means that once a tuple is created, its elements cannot …

  5. 11.1. Tuples are ImmutablePython for Everybody - Interactive

    Tuples are Immutable¶ A tuple is a sequence of values much like a list. The values stored in a tuple can be any type, and they are indexed by integers. The important difference is that tuples …

  6. Python Tuple - An Immutable Sequence - AskPython

    Jul 19, 2019 · Python tuple is an immutable sequence. The tuple is created with values separated by a comma. Since a tuple is immutable, we can’t add or delete its elements. If the tuple …

  7. Python Tuples - Python Guides

    Python Tuples are ordered, immutable collections used to store multiple items. They support indexing and can hold mixed data types, just like lists. ... Tuple List; Mutability: Immutable: …

  8. Mutable tuples - Python Morsels

    Jun 28, 2021 · Tuples are immutable in Python, but tuples can contain mutable objects. So (strangely) if a tuple contains a mutable object, it's possible for the value of that tuple to change.

  9. Mutable vs Immutable Types in Python - PyTutorial

    Feb 15, 2025 · In Python, mutable and immutable types serve different purposes. Mutable types like lists and dictionaries allow in-place modifications, while immutable types like strings and …

  10. Python Tuples are Immutable, Except When They're Mutable

    Feb 5, 2018 · In Python, tuples are immutable, and "immutable" means the value cannot change. These are well-known, basic facts of Python. While tuples are more than just immutable lists …

  11. Some results have been removed
Refresh