learning to program with Python

stewart stewart at midtoad.homelinux.org
Mon Feb 23 01:15:32 EST 2004


Ricardo wrote:

>  The code in wich i'm
> having problems is as follows:
> 
...
> if corPelo != None
>   self.corPelo = corPelo
...

Oi Ricardo, tudo bem?

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

Boa sorte!
S




More information about the Python-list mailing list