Is there any significant difference between the two python keywords continue and pass like in the examples
for element in some_list
There is a difference between them, continue skips the loop's current iteration and executes the next iteration.pass does nothing. It’s an empty statement placeholder.
I would rather give you an example, which will clarify this more better.
>>> for element in some_list:
... if element == 1:
... print "Pass executed"
... pass
... print element
...
0
Pass executed
1
2
>>> for element in some_list:
... if element == 1:
... print "Continue executed"
... continue
... print element
...
0
Continue executed
2