Okay, so I’m interested to know why the following code doesn’t work (specifically the “continue” part. I understand the given solution (using lst = lst[1:], but I think the way on that the picture shows also makes sense…
Hi @py1026655807,
Your continue
statement causes the following statement to be skipped during every iteration of the while
loop, so i
never gets incremented:
i += 1
See 4.4. break and continue Statements, and else Clauses on Loops.
Thanks a lot
1 Like