Python-oriented process-and functional programming

Source: Internet
Author: User

Saturday Leisure afternoon, see the blog Park a number of great gods technology stickers. As a pupil who do not understand anything, but also opened their own blog, later can be installed in the X into a pseudo-great God. The first piece of this afternoon learned the basics of Python:

1. Process-oriented programming: in Python, the process is not much different from the function, but it also requires def to be defined, but the process has no return value.

Def Guocheng ():

Print (' I am the process ')

The above definition is a procedure, there is no return value, only the relevant logic inside the function.

Call the above procedure: A=guocheng () so that it can be called, if you print a on the panel, none is displayed because the procedure has no return value.

2. Functional Programming:

To define a function:

def Funciton ():

Print ("I am a function")

Return ' I am the returned value of the function '

Call Function:

B=function (), and then the B printed on the panel, the string "I am the return value of the function" appears.

Just started to learn, feel write is particularly simple things, haha.

Python-oriented process-and functional programming

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.