Sebastiaan van Vugt7,126 Points
Does pass do the same as continue?
Instead of continue I tried to use pass in a while loop. Even though it runs it doesn't seem to do anything. Is it right that pass and continue are equivalent but that pass should be used in a for loop and continue in a while loop?
Thanks for insights on this matter.
Steven Parker200,760 Points
You can use "continue" in any kind of loop, but it cannot be used outside of a loop. It causes the loop to repeat immediately without waiting until the the current iteration completes. It might appear to be doing nothing if it's at the end of the loop.
On the other hand "pass" can be used in or out of loops. It serves only as a placeholder and doesn't do anything.