Let's say I have a list somewhere called majorPowers
which contain these two lists:
axis=["germany","italy","japan"]
allies=["russia","uk","us"]
I'd like to insert each of the elements of these lists, into a new mega-list. I'm currently doing this:
>>> temp = []
>>> temp = [ww2.append(t) for t in majorPowers]
>>>ww2
[['germany','italy','japan'],['russia','uk','us']]
How do I adjust this to not use the temp
and to insert the individual elements into ww2
instead of the lists themselves(axis
and allied
).
Also, would the new mega-list itself be classed as a comprehensive list, or the process of making it?
EDIT:
Please note I do not want to do:
for a in list1:
for b in a:
c.append(b)
@S.Lott. I understand your point. However I'm trying to learn some of the tricks in Python, instead of the standard way I'd usually do things. This is just to open my mind to Python a little more!