The 16th chapter of the Python Learning Handbook, the basic function of 4th

Source: Internet
Author: User

" " Date: September 5-September 30 Requirements: 1. Summary of the book contents, finishing in the blog Park notes upload 2. After all the exercises in the course Note: "#" After the addition of the notes (42 pages per day, you can guarantee to read this book at the end of the month) "Key Notes" "chapter Exercises"-Heading 1, level two headings- Heading 2, Notes outline title, exercise title-Bold, 16px"
Key Notes

Summary

Functions are the most basic program structure provided by Python for maximum code reuse and minimization of code redundancy.
I. Why use a function

Maximized code reuse and minimization of code redundancy

Decomposition of processes

This chapter exercises:

1. What is the meaning of writing a function?

A: Code reuse, Code concise, support independent development, improve efficiency.

2. When will python create a function?

A: When you run to the DEF statement, the function is created.

3. When a function does not have a return statement, what does it return?

Answer: Returns the None object.

4. When does the statement inside the function definition run?

A: The function body executes when the function is called by a call expression later. Each time the function is called, the principal is executed once.

5. What is wrong with checking the object type of the incoming function?

A: The flexibility of the destruction function, the function of the Prophet on a particular type. Without such checks, the function may handle all object types: Any object that supports the intended interface of the function can be used.

The 16th chapter of the Python Learning Handbook, the basic function of 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: 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.