Is there a difference between `continue` and `pass` in a for loop in python?
问题 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? 回答1: Yes, they do completely different things. pass simply does nothing, while continue goes on with the next loop iteration. In your example, the difference would become apparent if you added another statement after the if : After executing pass , this further