learning to program with Python

Nicolas Fleury nid_oizo at yahoo.com_removethe_
Mon Feb 23 08:09:08 EST 2004


stewart wrote:
> I see at least two problems here.  Python requires brackets around the 'if'
> comparison, and a colon at the end of the if statement.  Try re-writing
> your statement as:
> if (corPelo != None):
>    self.corPelo = corPelo

No, Python doesn't require parenthesis or brackets around the 
comparison.  Any expression can have optional parenthesis.

if corPelo != None:
    self.corPelo = corPelo

is enough.

Regards,

Nicolas



More information about the Python-list mailing list