The code below works as expected the first time (loop, when i is 0), but when i becomes 1 the loop stops at the first if len(k) > count: and moves all the wa
if len(k) > count: