[Solved] Python, def_init_(self): syntax error


Instead of

def_init_(self,name,age)

You should use

def __init__(self,name,age):

def means you start a function (definition), and it needs a space to follow.

The function __init__ is the constructor.

There should always be a colon at the end of a function definition (followed by the body of the function).

0

solved Python, def_init_(self): syntax error