Thursday , September 19 2024

The 0o prefix means that the number after it is denoted as:

Questions BankCategory: Python Essentials 1The 0o prefix means that the number after it is denoted as:
The 0o prefix means that the number after it is denoted as:

  • decimal
  • octal
  • binary
  • hexadecimal

Explanation: If an integer number is preceded by 0o or 0O, it will be treated as an octal value. For example: 0o246 is an octal number with a decimal value equal to 166.

If an integer number is preceded by 0x or 0X, it will be treated as a hexadecimal value. For example: 0x246 is a hexadecimal number with a decimal value equal to 582.

Finally, if an integer number is preceded by 0b or 0B, it will be treated as a binary value. For example: 0b1111 is a binary number with a decimal value equal to 15.

More Questions: Python Essentials 1 – Module 2 Test