Getting error on my code

Dappy Jr via Tutor <[email protected]> Fri, 31 Jan 2025 08:51:37 +0100
Newsgroups gmane.comp.python.tutor
Message-ID <CAFOaNTbSGy1D-+iHxQuUcYxowiNP0VMxZ+BR_5mKLEibLJDLNA@mail.gmail.com>
class Dog():

def _init_(self , name , age):
self.name = name
self.age = age
print(self.name.title() + self.age)

my_dog = Dog('willie' , 6)
print("My dog's name is " + my_dog.name.title() + '.')
print("My dog is " + str(my_dog.age) + 'years old.')


I'm trying to create a class Dog and print with attributes name and age as
'willie' , 6years old. Whenever i run the code i keep getting Dog() takes
no argument error message..

Traceback (most recent call last):
  File "C:\Users\OLADAPO JR\python_work\Classes\dog.py", line 8, in <module>
    my_dog = Dog('willie' , 6)
             ^^^^^^^^^^^^^^^^^
TypeError: Dog() takes no arguments

My OS = Windows
Python Version = 3.12
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor