Python syntax for an empty while loop -
Python syntax for an empty while loop -
i have written this:
while file.readline().startswith("#"): go on
but suspect continue
unnecessary? right syntax i'm trying achieve?
while file.readline().startswith("#"): pass
this uses pass statement :
the pass statement nothing. can used when statement required syntactically programme requires no action.
http://www.network-theory.co.uk/docs/pytut/passstatements.html
python while-loop
Comments
Post a Comment