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: