Hey,
I am writing a basic class and I am having problems inserting arguments into the class "Dog".
Here is the source code
I am writing a basic class and I am having problems inserting arguments into the class "Dog".
Here is the source code
class Dog(): def _init_(self, name, age): self.name = name self.age = age def sit(self): print(self.name.title() + ' is now sitting.') def roll_over(self): print(self.name.title() + ' is now rolling over.') my_dog = Dog('Willie', 6) print("my dog's name is " + my_dog.name.title() + ".") print('my dog is ' + str(my_dog.age) + '.')here is the error message:
Error:Traceback (most recent call last):
File "C:/Users/maxya/PycharmProjects/classes.py", line 28, in <module>
my_dog = Dog('Willie', 6)
TypeError: Dog() takes no arguments
Thank you for your help.