tall = [0, 0, 3, 4, 0, 5, 0, 0, 0] tall = [4, 5, 0, 0, 0, 0] while len(tall) > 0 and tall[0] == 0: tall.pop(0) while tall and tall[-1] == 0: tall.pop() print(tall)