Home > Backend Development > Python Tutorial > How does python represent octal?

How does python represent octal?

little bottle
Release: 2019-05-30 15:38:45
Original
25741 people have browsed it

I have learned various base expressions when learning C language before. Python also has base expressions like C language. So how to use them? Let’s find out together below.

How does python represent octal?

The binary number in Python starts with 0b:

For example: 0b11 means decimal 3

>>>0b11
Copy after login

The octal number starts with Starting with 0:

For example: 011 means 9 in decimal system

>>>0o11    //这里是英文字母o
Copy after login

16 starts with 0x:

For example: 0x11 means 17## in decimal system #

>>>0x11
Copy after login

The above is the detailed content of How does python represent octal?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template