Why does Python change the value of an integer when there is a 0 in front of it?

前端 未结 4 363
眼角桃花
眼角桃花 2021-01-14 18:14

I implemented a function converting an integer number to its representation as a string intToStr() (code below).

For testing I\'ve passed in some values

4条回答
  •  无人共我
    2021-01-14 19:00

    Numbers that start with a 0 are interpreted as octal numbers. If it starts with 0x it's hexa decimal.

提交回复
热议问题