„Ten konstruktor nie przyjmuje argumentów” w __init__

Podczas uruchamiania następującego kodu pojawia się błąd:

class Person:
  def _init_(self, name):
    self.name = name

  def hello(self):
    print 'Initialising the object with its name ', self.name

p = Person('Constructor')
p.hello()

Dane wyjściowe to:

Traceback (most recent call last):  
  File "./class_init.py", line 11, in <module>  
    p = Person('Harry')  
TypeError: this constructor takes no arguments

Jaki jest problem?

questionAnswers(2)

yourAnswerToTheQuestion