Python 列表和元组学习


List1 = [1, 2, 3]
List2 = [1, 2, 3, 'a', 'b']
List3 = [1, 2, 3, 'a', 'b',[1, 2, 100]]

List2[1] = 20
List2[4] = 'hello'

print(List1)
print(List2)
print(List3)
print(id(List1))
print(id(List2))
print(id(List3))

输出结果

元组

序列和元组支持的所有操作

猜你喜欢

转载自blog.csdn.net/moonlightpeng/article/details/85344995