How can I increment a list in python.In the following case
So that means
I want to append several lists into a single list is is easy like list1+list2
But I need to return a final list where all the lists will be appended and every single list will be an result of iteration.What I was trying like below:
def result():
temps = [list of links]
final_list = []
for link in temps:
final_list = final_list+get_list(link) # get list returning a list and temps is a list
return final_list
def get_list(link):
#process the link and return a list
return li
But as every time before the loop,final_list is being initialized,I am getting the []+get_list()
I need all the previous values in my final list.
Sample input: [a list of links] Sample out put:final_list #contains
all the data as a single list returned from get_list()
So you want to turn a list of something into a list of lists and flatten it?