[python] Why is this printing 'None' in the output?

I have defined a function as follows:

def lyrics():
    print "The very first line"
print lyrics()

However why does the output return None:

The very first line
None

This question is related to python nonetype

The answer is


Because of double print function. I suggest you to use return instead of print inside the function definition.

def lyrics():
    return "The very first line"
print(lyrics())

OR

def lyrics():
    print("The very first line")
lyrics()