Open hellokaton opened 6 years ago
https://dev-cheats.com/python-full-stack/tuple-data-type.html
元组(tuple)和列表的为唯一区别就是列表可以更改,元组不可以更改,其他功能与列表一样 创建元组的两种方法 第一种 ages = (11, 22, 33, 44, 55) 第二种 ages = tuple((11, 22, 33, 44, 55)) 如果元祖内只有一个元素,那么需要加上一个逗号,否则就变成字符串了。
https://dev-cheats.com/python-full-stack/tuple-data-type.html
元组(tuple)和列表的为唯一区别就是列表可以更改,元组不可以更改,其他功能与列表一样 创建元组的两种方法 第一种 ages = (11, 22, 33, 44, 55) 第二种 ages = tuple((11, 22, 33, 44, 55)) 如果元祖内只有一个元素,那么需要加上一个逗号,否则就变成字符串了。