(1, "ios")
>>> list1
['Python', 'ios', 'Android', 'Java', 'C++', 'JavaScript']list修改元素 list中的元素也可以进行修改...,通过索引直接进行替换: >>> list1[1] = 'Ruby'
>>> list1
['Python', 'Ruby', 'Android', 'Java', 'C++', 'JavaScript...补充:tuple(list)函数:将list转换为tuple,list(tuple)函数:将tuple转换为list:
# list转tuple:
>>> l = [1, 2, 3]
>>> tuple...(l)
(1, 2, 3)
# tuple转list:
>>> t = ('a', 'b', 'c')
>>> list(t)
['a', 'b', 'c']
二、字典(dictionary)和集合(...2、值可以取任何数据类型,如字符串,数字或元组,但不能为列表,但键必须是不可变的。