Def mystery()


#1

What does def mystery() mean in python?


#2

def is short for define. mystery() is a function.

def mystery():
    print "What is the meaning of life?"

The first line is called the header or signature line. The code that follows is called the code block or function body.

To execute the function, we call it.

mystery()    # What is the meaning of life?

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.