Python 3 Grammar Note (1): Basic data type

Source: Internet
Author: User
1 Boolean

True and false are automatically converted to integers 1 and 0 under the arithmetic operator:

If the Boolean detection of the IF statement, encountered a non 0 is considered true, encountered 0 is considered false:

2 number

Number includes int and float, which can be converted to each other using float () and int ().

In Python 3, there is no concept of long, int is infinitely large and is not limited by Sys.maxint. The floating-point number can only be exactly 15 digits after the decimal point:

/= floating point except,//means integer except, * * is the second side,% is the remainder:

Fractions is a fractional library that can represent fractions:

Python 3 Grammar Note (1): Basic data type

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.