假设我有两个一维列表
firstList = [ "sample01", None, "sample02", "sample03", None ]
secondList = [ "sample01", "sample02", "sample03", None, None, None, "sample04"]
现在我正在寻找将返回但没有 None 对象的 listComprehension 的firstList
配方secondList
。
所以它应该看起来像这样
listComprehension_List = [ [ "sample01","sample02","sample03" ] , [ "sample01","sample02","sample03", "sample04" ] ]
listComprehension_List = [[firstList without NONE objects],[secondList without NONE objects]]
我期待任何输入......现在我将继续尝试!