Python oct() Function
Python’s built-in oct(integer) function takes one integer argument and returns an octal string with prefix “0o”. If you call oct(x) on a non-integer x, it must define the __index__() method that returns an integer associated to x. Otherwise, it’ll throw a TypeError: object cannot be interpreted as an integer. Argument integer An integer value or … Read more