Home >>Python Built-in Functions >Python oct() Function
Python oct() function is used to convert a given input integer into an octal string. Octal strings in Python are prefixed with 0o.
Python oct method accept an argument and returns an integer converted into an octal string.
Syntax:oct(int)
Parameter | Description |
---|---|
int | This parameter defines an Integer Number. |
x = oct(55)
print(x)
x = oct(523)
print(x)