The function in the Python class has been defined. Print, added print (), when calling the instance. How to understand the result?

question: there is already print (), in
sit () and roll_over () functions.
when the instance calls the function, it uses print (),
. The result turns out to be no error, but shows the correct statement and None,
how to understand None?.

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() + " rolled over!")

my_dog = Dog ("willie",6)

print (my_dog.roll_over ())

)

result:

Jun.24,2021

is equivalent to outputting none with no return value after my_dog.roll_over () execution

Menu