oct

oct(x)

Returns the number converted to a octal string (built-in).

arraylistThe name of the array.

REMARKS
* This is a built-in function.
* Convert an integer number to an octal string prefixed with "0o". The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer. For example:
* If you want to convert an integer number to an octal string either with the prefix "0o" or not, you can use either of the following ways.
* link to Excel
* You can use the octdigits constant
* You can use the bin function to
* You can use the hex function to
* For the Official documentation refer to python.org

oct(8)                    #= '0o10'  
oct(10) #= '0o12'
oct(-56) #= '-0o70'

%#o' % 10 #= '0o12'
%o' % 10 #= '12'
format(10, '#o') #= '0o12'
format(10, 'o') #= '12')
f'{10:#o}' #= ('0o12'
f'{10:o}' #= '12'

© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited Top