Python data type

Source: Internet
Author: User

int (shaping)

Integer in Python2 shaping, long shaping. 32-bit value range -2**31~2**31-1. 64-bit shaping with a value range of -2**63-3**63-1.

Long (length shaping)

There's no long python3 inside.

Float (floating point)

Boolean value

1 or 0

True or False

A = 0if A:print('a'= 1If A:print( ' a ' ) A

Complex (plural)

% modulus

8%2

0

9%2

1

The simplest solution

Take the Divide

10.3//3

3.9

10.3/3

3.4333333

Operator

= = equals

! = Not equal to

<> Not equal to

Assignment operations

Logical operations

And,or,not

A,b,c = 3,5,7 and C < 7False
 and  and B > 4True
 and  and or c = =8 and andor c = = 8False

Not

" 333 " if  not A.isdigit ():print("ddd""AAA " if  not A.isdigit ():print("ddd") ddd

Inch

Not in

\

Is isn't

Python data type

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.