Python Beginner Learning Basics Function-Concepts and definitions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.