0
Why it’s result is 10
a=0o12 Print(a) 10
5 ответов
+ 7
Octal literals, numbers in octal format are prefixed with 0o.
https://www.python.org/dev/peps/pep-3127/
+ 5
ishu Shrivas Octal literals, are numbers of base 8.
0o12
= (8^1)*1 + (8^0)*2
= 10
0o78 results in syntax error because it is impossible for the number 8 to appear anywhere within the expression of an octal literal.
Please refer to this table:
https://www.rapidtables.com/math/number/Numeral_system.html
+ 1
okk now it is clear
thank u very much Hatsy Rei
0
i didn’t understand Hatsy Rei
please clear it easily ...
0
& why there is error in the following codes
c=0o78
print(c)
syntax error