Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc9a4d8

Browse files
committed
Fix text about int() with octal numbers. Closes #21212.
1 parent f6e50b4 commit fc9a4d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ By default, these interpret the number as decimal, so that ``int('0144') ==
711711
144`` and ``int('0x144')`` raises :exc:`ValueError`. ``int(string, base)`` takes
712712
the base to convert from as a second optional argument, so ``int('0x144', 16) ==
713713
324``. If the base is specified as 0, the number is interpreted using Python's
714-
rules: a leading '0' indicates octal, and '0x' indicates a hex number.
714+
rules: a leading '0o' indicates octal, and '0x' indicates a hex number.
715715

716716
Do not use the built-in function :func:`eval` if all you need is to convert
717717
strings to numbers. :func:`eval` will be significantly slower and it presents a

0 commit comments

Comments
 (0)