I am a newbie by python and now am stuggling because can't get the needed output. I also tried many solutions which I found here, but somehow I can't get it correctly. So, please, explain me, what is my mistake.
I have a list like this:
list_of_l= [['ototot'], ['tototo'], ['ttoott'], ['ottott']]
what I wanna have is something like this
new_list= [['o','t','o','t','o','t'], ['t','o','t','o','t','o'], ['t','t','o','o','t','t'], ['o','t','t','o','t','t']]
and I want to have a for loop, because my list_of_l may have a different length.
so what I tried so far:
I get only the wished split when i work with string
t='ototot'
o=[t[i:i + 1] for i in range(0, len(t), 1)]
print(o)
Output: ['o','t','o','t','o','t']
the problem is that when I try to make a for loop, I cant split it, because it is a list and not a str. My question may be kinda stupid, but I really don't get it.
So I tried to make a for loop, but failed...
for k in range (len(list_of_l)):
# and here is my disaster, I don't get what to do here.
Please help T-T
UPDATE:
It is working now! I am very thankful for your help everyone and sorry, if my question was kinda stupid :D
UPDATE 2:
And then just random question(I want just to understand how it works), is it also possible to make a list of list of lists?? No idea how to explain it, something like this:
list_of_l= [['ototot'], ['tototo'], ['ttoott'], ['ottott']]
new_list= [[['o'],['t'],['o'],['t'],['o'],['t']], .......]