What is the dummy statement that do nothing in Python?

Carroll, Barry Barry.Carroll at psc.com
Wed Jan 31 18:07:15 CET 2007


> -----Original Message-----
> From: Dongsheng Ruan [mailto:ruan at jcmills.com]
> Sent: Wednesday, January 31, 2007 8:50 AM
> To: python-list at python.org
> Subject: What is the dummy statement that do nothing in Python?
> 
> I remember that in python there is some kind of dummy statement that
just
> holds space and does nothing.
> 
> I want it to hold the place after a something like if a>b: do nothing
> 
> I can't just leave the space blank after if statement because there
will
> be
> error message.
> 
> Does anybody know what to insert there?
> 
> Thanks!
> 
> 
Greetings:

Try 'pass':

<CODE>
if a>b:
    pass
else:
    dosomething()
</CODE>

Regards,
 
Barry
barry.carroll at psc.com
541-302-1107
________________________
We who cut mere stones must always be envisioning cathedrals.

-Quarry worker's creed





More information about the Python-list mailing list