Python numeric Type (integer, long, float, plural)

Source: Internet
Author: User

First, the integral type

In [1123              # defines an integer type  in [2]: Type (a)              # View data type out[  2int

-2147483648--2147483647 # The range of integer values, if this range is exceeded, becomes a long integer type

Second, long integer type

In [7123456789123456789123456789    # defines long integer in [8]: Type (a)                            # View Data Types out[8Long in[9]: A                                  # is followed by a letter (L or L) to identify that this is a long integer type out[9123456789123456789123456789L

Third, floating-point type

In [1.0    # Data type with decimal point is floating-point
In [all]: b = 3e+7 # scientific notation also belongs to floating-point type
In [all]: type (a) # View data type out[onefloat

Four, plural type

in [+]: a = 123j    # The letter J is used to identify this is a plural type in []: Type (a)     # View data type out[]: Complex

Python numeric Type (integer, long, float, plural)

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.