为什么需要元组?
- 字符串中操作提取姓名、年龄、性别的方式不方便,诞生元组。
元组的定义
- 定义空元组 tuple = ()
- 定义单个值的元组 tuple = ()
- 一般的元组 tuple = (name,21.180)
元组特性
- 不能对元组的值任意更改 :
元组特性
- 索引,切片,连接,重复,成员操作符,for循环
it's just like list but not stronger than list
it's just like list but not stronger than list