Home > Article > Backend Development > What is 0o1010 in python
python What is 0o1010? It starts with 0, meets the requirements of octal, and is an octal number. Let’s take a look at the four forms of expression of integers:
For integers: there are four forms of expression
Binary: 0, 1 is entered as 2 as 1
Octal: 0-7 as 8 is entered as 1, starting with 0
Decimal: 0- 9 is the base of 10.
Hexadecimal: 0-9, A-F is the base of 16. Use 0x to represent
bit (bit): the smallest unit for storing information, representing a binary number .
Byte: A byte is composed of 8-bit binary numbers (1Byte=8bit). Byte is the basic unit of storage and information organization.
1K = 1024Byte
1M = 1024K
1G = 1024M
1T = 1024G
Related recommendations: "python Video tutorial》
Let me introduce to you the basic method of converting 0o1010 into our commonly used decimal system.
The first step is to click on the menu bar, search for IDLE, and open the shell.
The second step is to enter the code converted from octal to decimal, int ('the number after the decimal symbol', the decimal number), for example, 0o1010, the number is 1010, The base number is 8.
The third step is to enter the conversion result.
The above is the detailed content of What is 0o1010 in python. For more information, please follow other related articles on the PHP Chinese website!