A brief analysis of Python's understanding of Return

Source: Internet
Author: User

Recently very busy, but still very serious learning python this thing, not for what purpose, just like simply. Recently learned things relatively simple, but also encountered a number of problems, is to compare the problem of confusing people, today's small series here to talk about their understanding of return.

The return statement is a value returned by a function in the Python language, and each function should have a return value, where the return value can be a numeric value, a string, a Boolean value, or a list.

But what is the function of the return statement in Python, and the small part by example for everyone to speak well.

first of all, the Python function returns the value return, the function must have return return value is the complete function, if you do not define the Python function return value, then get a result is None object, and none means no value

Here's an example:

By this two simple contrast, can you see the importance of return? In fact, there is no special use of return, beginners only need to remember the function to have a return value.

A brief analysis of Python's understanding of Return

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: 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.