I cannot understand what this line means:
queue = [list() for _ in range(k)]
This is the full code:
for i in range(1, maxlen+1):
queue = [list() for _ in range(k)]
for word in words:
word += (maxlen - len(word)) * ' '
if ord(word[-i]) >= 97:
queue[ord(word[-i]) - (97)].append(word)
else:
queue[0].append(word)
words = sum(queue, [])
for i in range(len(words)):
words[i] = words[i].replace(" ", "")
print(words)