Life is short I learn Python OldBoy21 day entry _day02 data type, character encoding learning

Source: Internet
Author: User

A decimal turn binary

Decimal integers are converted to binary integers using the "Divide 2, Reverse order" method. The specific method is: divisible by 2 decimal integers, you can get a quotient and the remainder, and then 2 to remove the quotient, and then get a quotient and the remainder, so that until the quotient is 0 o'clock, and then the first obtained remainder as a binary number of the low-effective bit, the remainder as a binary number of the high-level effective bit, and then arranged together

255= (11111111) B

255/2=127===== Yu 1127/2=63====== more than 163/2=31======= 131/2=15======= more 115/2=7======== 17/2=3========= Yu 13/2=1========= Residual 11/2=0========= 1 each bit 1 or 1 of the space unit is bit (bit), which is the smallest representation of the computer in the unit 8bit = 1byte (bytes) The smallest storage unit, 1bytes abbreviation for 1b1kb = 1024B1MB = 1024kbpython2 default use ASCII code python3 default use Utf-8, all python3 to Chinese support a little better

Life is short I learn Python OldBoy21 day entry _day02 data type, character encoding learning

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.