In Python, a tuple is an immutable data structure designed to store multiple elements, which can be accessed using index values. Tuples are similar to lists, but with one key difference: once a tuple is created, its elements cannot be added, deleted, or modified. This chapter explores how tuples are implemented and highlights some of their interesting characteristics.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

The Tuple Object and Its Immutability

  • Chien-Lung Kao

摘要

In Python, a tuple is an immutable data structure designed to store multiple elements, which can be accessed using index values. Tuples are similar to lists, but with one key difference: once a tuple is created, its elements cannot be added, deleted, or modified. This chapter explores how tuples are implemented and highlights some of their interesting characteristics.