I know that in Python there's the possibility of converting a given string into a list:
>>> h='ghilmnoPqzH'
>>> list(h)
['g', 'h', 'i', 'l', 'm', 'n', 'o', 'P', 'q', 'z', 'H']
But how can I split the list into given intervals? I.e., given the above string h
if I set a parameter s=4
I should get
['ghi', 'lmn', 'oPq', 'zH']
This question is different from How do you split a list into evenly sized chunks in Python? because, if I use that function I get the following error:
<generator object chunks at 0x0296A030>