Python Learning (iii)

Source: Internet
Author: User

Basic data Type one, integer type (int)

32-bit machine, the number of digits of the integer is 32 bits, the value range is -2**31~2**31-1, namely -2147483648~2147483647

64-bit machine, the number of integers is 64 bits, the value range bit -2**63~2**63-1, that is -9223372036854775808~9223372036854775807

Bit_lenth (): Minimum number of bits to use when decimal is represented in binary

A = 6= ten=print(a.bit_length ())print(b.bit_length ())  Print(C.bit_length ())

The output is: 3,4,7

Two, Boolean type (BOOL)

String Conversion bit Boolean: bool (str), when the string is an empty string, converted to false, otherwise converted to true

' AFDS,BNK '   "' Print (bool (a), bool (b), BOOL (c))

The output is: true,false,true

"' if A:     Print (' correct ') Else :     Print (' error ')

The output is: Error

C. String type (str):

  

Python Learning (iii)

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.