Is there any significant difference between the two Python keywords continue and pass like in the examples
for element in some_list:
if not element:
pass
and
for element in some_list:
if not element:
continue
I should be aware of?
Yes, they do completely different things.
passsimply does nothing, whilecontinuegoes on with the next loop iteration. In your example, the difference would become apparent if you added another statement after theif: After executingpass, this further statement would be executed. Aftercontinue, it wouldn’t.