Def mystery()


What does def mystery() mean in python?


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?


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