Sublime Forum

Result print

#1
for x in range(1, 11):
	print("%02d"%x, end=" ")

it is not a problem but it is just a curiosity:
how come the numbers 08 and 09 are colored in white?
is a simple print in a For loop, formatting in string with 0
is there a specific reason? thanks.

0 Likes

#2

Because 08 and 09 are no valid octal values and thus not scoped as such. see: https://stackoverflow.com/questions/11620151/what-do-numbers-starting-with-0-mean-in-python

The 10 is a normal integer.

1 Like

#3

ok thanks, deathaxe

0 Likes