Q:

Making list inside list from loop

In this code here:
dotted_map = []
for row in range(3):
    dotted_map.append("".join(list(2*'o ' + 'o')))
print(dotted_map)

It is printing
['o o o', 'o o o', 'o o o']

I want it to print this:
[['o o o'], ['o o o'], ['o o o']]

Why is it not doing that?

A:

As pointed out in the comments, you just have to do it this way
dotted_map.append([2*'o ' + 'o'])

In your way, the list() method makes it into a list, but then the join() method, converts the list back into a string.
2*'o ' + 'o' # is a string 'o o o'
list(2*'o ' + 'o') # is a list ['o o o']
"".join(list(2*'o ' + 'o')) # is a string again 'o o o'

