What is a function?
A function is a method or a program that can implement certain functions, and a simple understanding of the concept of a function is that you write statements that, for ease of use, combine these statements to give it a name, the function name. When you use this name, you can implement the function in the statement group.
Some of the functions in Python are called built-in functions and do not need to be written by ourselves. There is also a third-party function, is the other programmer compiled some functions, shared for everyone to use. Both of the functions mentioned above are used directly by you. There is, of course, a function that we have written to make it easy to use, called a custom function.
Define a function
Python uses def to define a function, and we can execute the contents of a block of code more conveniently through a custom function, with the definition of Def as follows:
def function name (argument list): function Body
Defining a function, for example, is just a definition:
More learning content, just in the code bud Net Http://www.mayacoder.com/lesson/index
Python Beginner Learning Basics Function-Concepts and definitions