- 列表的嵌套 (降维操作)
lst = ["张三","李四","王麻子",["王五","赵六",[20,"小七","alan"]]]
print (lst[3][2][1])#小七
lst[3][2][2] = lst[3][2][2].upper()
print (lst)
- 列表的其他操作
lst = [2,1,44,4,4,55,11,5,1,15,4]
lst.sort() # 排序,默认升序;
lst.sort(reverse=True) # reverse=True 默认降序
print (lst)
lst = ["武","我","问","闻","舞","维","沃"]
lst.reverse() # 翻转
print (lst)
print (len(lst)) # 列表的长度