I've got an object that looks something like this:
obj = {
"outer_list": [
{
"inner_list_1": ["string1", "string2"]
},
{
"inner_list_2": ["string3", "string4"]
}
]
}
I want to create a new list that is the combination of both inner lists:
["string1", "string2", "string3", "string4"]
Currently, I've got something like this:
result = []
for inner_object in obj['outer_list']:
for my_str in inner_object['inner_list']:
result.append(my_str)
I'm wondering how to write that nested loop in a single line.
result = [...]