Python Introductory Learning-modules

Source: Internet
Author: User

1. Module

You can think of modules as extensions that are imported into Python to enhance their functionality. You need to import the module using a special command import. Import the module with import and use the module's function in the format "module. function"

That's how it works.

To convert the age to an integer (32) instead of a floating-point number (32.0), use the INT function. Note: An int function/type converts a parameter to an integer that is automatically rounded down, so math.floor is superfluous during the conversion process.

You can use the function int (32.9) directly.

1.1 Cmath and plural

Imaginary numbers are processed using modules Cmath (i.e., complex math, complex number)

1j is an imaginary number, and the imaginary numbers end with J (or J), just as long integers use L. The following example is used to illustrate how to use the plural:

As you can see, the Python language itself provides support for complex numbers. Note: There are no separate imaginary types in Python. They are considered to be part of the real number 0 plural

Python Introductory Learning-modules

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.