What does 'continue' do in a loop?

Asked by stem_mind · 4 months ago

1 Answer

10
amorebise · 4 months ago Top Answer

continue tells Python to skip the rest of the code for this item and jump straight to the next one in the list.

Imagine you are sorting fruit. If you pick up a rotten one, you don't want to wash it or pack it; you just put it aside and continue with the next fruit. It’s a skip button.

Log in to add a comment.