for element in some_list: if not element: pass print 1 # will print after pass for element in some_list: if not element: continue print 1 # will not print after continue
Here is what the above code is Doing:
1. The first for loop will print 1 after the pass statement because the pass statement does nothing.
2. The second for loop will not print 1 after the continue statement because the continue statement will skip the rest of the code in the loop and go back to the top.