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

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

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