w = ['a','b','c','d','e','f','g','h']
l = []
a = w[0:2]
b = w[2:4]
c = w[4:6]
d = w[6:8]
l = [a,b,c,d] #[['a', 'b'], ['c', 'd'], ['e', 'f'], ['g', 'h']]
How can i get the same result ('w' to 'l') using loop method instead of slicing multiple times? Assuming i dont know how many characters can there be in 'w' variable (in this example it is just from 'a' to 'h'), and slicing will always start from 0 but the range in unknown(where in this example it is 0:2)
Thank You very much.