Pmd091023 (26/10/23)

  1. create class Dog
  2. identity - name
  3. state/attributes - breed, color, age
  4. behaviors - bark, sleep, eat
    5.create 4 object of Dog class and get all attributes and behaviour as output.

=============================================================
i have one doubt

when i use like this code

def bark(self):
print(self.name, " is barking")
def sleep(self):
print(self.name, " is sleeping")
def eat(self):
print(self.name, " is eating")

But output i am getting like NONE. may i know why it happen like this?

Max is a Black , Labrador who is 1 years old.
Max is barking
None
Max is sleeping
None
Max is eating
None

2 Likes

@praneethreddygadipel

But when i am running it in the way you have doubt.
The output is coming correctly.

1 Like

Answer.

1 Like