Why is None appearing on console window?


#1

Hi

Here’s the link for my exercise -https://www.codecademy.com/courses/learn-python/lessons/classes/exercises/creating-class-methods?action=resume_content_item.

Here is my code:

class Car(object):
condition = “new”
def init(self, model, color, mpg):
self.model = model
self.color = color
self.mpg = mpg
def display_car(self):
print “This is a %s %s with %dMPG.” %(self.model,self.color,self.mpg)
my_car = Car(“DeLorean”, “silver”, 88)
print my_car.display_car()

(Sorry for no indentations. I cannot do that)

Here’s is the output:

This is a DeLorean silver with 88
None

My question is why None apppearing on the console window?

Any answer will be appreciated

THANK YOU


#2

None is the implicit returned value by functions and methods, which gets printed if you put print statement before function or method call


#3

What do you by “implicit” here


#4

exactly what implicit means? If you don’t explicitly use return, a “default” value is returned (none), which you print because of the print keyword before the method call