Skip to content
Advertisement

How to merge all of the output lists into one list [closed]

I was trying the following code snippet for a project of mine:

JavaScript

I got this output:

JavaScript

I want all of these output lists to be put into one list, like:

[‘theodore’,’von’,’karman’,’science’,………….]

I understand that these individual outputs were produced due to loops, I’ve tried to do .append() for doing this and ended up with the c_list and they turned out to be independent lists. Any solution to this will be highly valued and appreciated. Thanks!

Advertisement

Answer

JavaScript

I assumes punc is tab list of punctuation.

Is this working for you ?

output :

[‘theodore’, ‘von’, ‘kármán’, ‘lecture’, ‘science’, ‘journey:’, ‘”the’, ‘origin’, ‘of’, ‘photosynthesis:’, ‘a’, ‘window’, ‘into’, ‘the’, ‘intricate’, ‘relationship’, ‘between’, ‘life’, ‘and’, ‘the’, ‘world’, ‘around’, ‘it”‘, ‘science’, ‘journey:’, ‘”addressing’, ‘energy’, ‘storage’, ‘challenges:’, ‘making’, ‘electrolytes’, ‘that’, ‘can’, ‘help’, ‘batteries’, ‘store’, ‘more’, ‘energy”‘, ‘science’, ‘journey:’, ‘”defects’, ‘in’, ‘crystals:’, ‘the’, ‘tiniest’, ‘engineering’, ‘tool”‘]

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement