I have a list of lists like
mylist = [[' a', ' b'],[' a', ' b', ' c'],[' a', ' c']]
I want to remove all spaces, I tried the below, but it then lists all items into one list ['a', 'b', 'a', 'b', 'c', 'a', 'c']
, while I want to preserve list of lists.
mylist2 = []
for i in mylist:
for j in i:
k = j.replace(' ','')
mylist2.append(k)