M. Bashir Al-Noimi wrote:
Hi All,
I couldn't understand the difference between pass and continue
keywords, could you explain to me?
Taken from the docs at http://docs.python.org/tutorial/controlflow.html
The continue statement continues the next iteration of a loop for eg.
for line in file:
if not line.strip(): # If the line is empty then
continue
The pass statement does nothing. It can be used when a statement is
required syntactically but the program requires no action. For example:
while True:
pass # Busy-wait for keyboard interrupt (Ctrl+C)
--
Kind Regards,
Christian Witts
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor