Python Learning Comprehension Section 4th

Source: Internet
Author: User

This section learns about functional and functional programming

Functions are designed to structure and process logic.

The procedure for defining a function is as follows:

Both functions and procedures are defined with Def, both of which can be called, and the procedure is a function that has no return value.

X=FUNC1 () #调用函数

Y=FUNC2 () #调用过程

Summarize

Number of return values = 0: Return None

Number of return values = 1: Return object

Number of return values >1: return tuple

Define a function with parameters

X, y is the formal parameter, which is the argument, and the position call corresponds to the parameter one by one

Important: Key parameters cannot be written in front of position parameters

Python Learning Comprehension Section 4th

Related Article

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: [email protected] 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.