一:一行实现双层循坏
list_a = [[‘Chris Pratt‘, ‘ Vin Diesel‘, ‘ Bradley Cooper‘, ‘ Zoe Saldana‘], [‘Noomi Rapace‘, ‘ Logan Marshall-Green‘, ‘ Michael Fassbender‘, ‘ Charlize Theron‘]] list_b = [i for j in list_a for i in j] print(list_b) # [‘Chris Pratt‘, ‘ Vin Diesel‘, ‘ Bradley Cooper‘, ‘ Zoe Saldana‘, ‘Noomi Rapace‘, ‘ Logan Marshall-Green‘, ‘ Michael Fassbender‘, ‘ Charlize Theron‘]
原文:https://www.cnblogs.com/shikaishikai/p/11254315.html