Answer to Question #232995 in Python for Alhaji

Question #232995

In math notation, leading zeros are OK, as in 02. What happens if you try this in Python and why


1
Expert's answer
2021-09-03T14:05:49-0400

if you try to use leading zeros including, you will get an error like this:

File "<string>", line 3

print(001)

^

SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers


because python doesn't support leading zeros in numbers




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