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

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

asp.net - .NET Control.ID property inconsistency -

r - url in CRAN extension manual -