Hi, my name is Ricardo and i'm learning to program in Python with
version 2.3.3, i'm also using the latest version of PythonWin(163) but
i'm trying to do it with a book (Written in Portuguese) that covers the
version 2.1, and of course i'm having a problem. The code in wich i'm
having problems is as follows:
class Gato:
"um felino domesticado"
def __init__(self, sexo, corPelo=None):
self.sexo = sexo
if corPelo != None
self.corPelo = corPelo
def miar(self):
if self.sexo == "m":
return "MIAU"
else:
return "miauuuu"
the book says that it should be done like this, but when i finnish the
5th line(if corPelo != None) and press ENTER, it gives me the error:
Traceback ( File "<interacti ve input>", line 5
if corPelo != None
^
SyntaxError: invalid syntax
I hope someone can help me?
Thanks in advance anyway.
Ricardo
version 2.3.3, i'm also using the latest version of PythonWin(163) but
i'm trying to do it with a book (Written in Portuguese) that covers the
version 2.1, and of course i'm having a problem. The code in wich i'm
having problems is as follows:
class Gato:
"um felino domesticado"
def __init__(self, sexo, corPelo=None):
self.sexo = sexo
if corPelo != None
self.corPelo = corPelo
def miar(self):
if self.sexo == "m":
return "MIAU"
else:
return "miauuuu"
the book says that it should be done like this, but when i finnish the
5th line(if corPelo != None) and press ENTER, it gives me the error:
Traceback ( File "<interacti ve input>", line 5
if corPelo != None
^
SyntaxError: invalid syntax
I hope someone can help me?
Thanks in advance anyway.
Ricardo
Comment