list里面嵌套for循环if语句

对于列表里面嵌套for语句,始终有些迷糊。下面简单举几个例子来讲明一下。例如:web a_list = [1,2,3,4,5,6] new_list = [x for x in a_list] print(new_list) >>>[1,2,3,4,5,6] #可是a_list和new_list指向的不是同一个列表,也就是说,new_list建立了一个新的列表 new_list_list =
相关文章
相关标签/搜索