Home > Software design >  leading zero causes an exception in the program
leading zero causes an exception in the program

Time:11-12

i hope you are doing well.

I have a question maybe it is stupid to ask rather than search.

but I looked up for a satisfactory answer.

Why leading zero is not allowed in some language, such as python.

what problems can leading zero produce?

thanks in advance!

CodePudding user response:

This is not just in Python, many programming languages doesn't allow leading zeros. This is because zero is used to define if number is for example binary or octal base numbers. More about them in Python here.

  • Related