Home  >  Article  >  Backend Development  >  How does python represent octal?

How does python represent octal?

little bottle
little bottleOriginal
2019-05-30 15:38:4525634browse

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

The octal number starts with Starting with 0:

For example: 011 means 9 in decimal system

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

16 starts with 0x:

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

>>>0x11

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!

Statement:
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