Q:

Python list of lists depending on length

I have the lists below and I need to assign the strings from fruit list into stall list depending on their length. 
fruit = ['an', 'king', 'be', 'brave']
stall = [[],[],[],[]]

So the result should be like this
stall = [[ ],['an', 'be'],[ ],['king', 'brave']] 

I’ve tried so many ways and even attempted to create a new list to see where I am going wrong but not even this is populating anything. Can someone please point me where I am going wrong? I've never had to append to list of lists before.
i = 0
s = stall[i]
for j in fruit:
    if(len(j)) == i+1:
        s.append(j)
        i += 1
print(stall)

A:

Assuming you want as many inner lists as you need to put in all words correctly:
fruit = ['an', 'king', 'be', 'brave']

stall = [
    [element for element in fruit if len(element) == i+1]
    for i in range(len(fruit) + 1)
]

stall will now be [[], ['an', 'be'], [], ['king'], ['brave']].

