Answer to Question #293563 in Python for chrisking4real

Question #293563
  • In math notation, leading zeros are OK, as in 02. What happens if you try this in Python and why?
1
Expert's answer
2022-02-03T08:39:08-0500

If Python sees an 8 or 9 after a leading zero, then it complains about an invalid octal number.

Python number 10 in each number base.

  1. decimal 10 the one we use every day cannot have a leading zero
  2. binary 0b1010
  3. octal 012 must have a leading zero
  4. hexadecimal 0x0A

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS