正文

Python中的tuple(元组)是一种不可变的数据结构,用于存储一系列有序的元素。以下是如何在Python中创建和使用tuple的基本步骤: 1. **创建tuple**: - 使用圆括号 `()` 来定义一个tuple。 - 元素之间用逗号 `,` 分隔。 ```python # 创建一个包含数字的tuple numbers = (1,