Line | Description |
---|---|
1 | Function header of the function decToOct() with the input parameter x |
2 | Returns the octal representation of the number x . The oct() function normally returns a string in the following form: ‘0o….’. The function .split() removes the substring 0o from the string |
4 | Calls the function with the parameter 125 and prints the result |
def decToOct(x):
return oct(x).split('o')[-1]
print(decToOct(125))
175