Python oct() function
Published February 16, 2022The oct() method is a Python built-in function for converting integer numbers to their octal counterparts. In this method, an integer is provided, and an octal string is returned.
Syntax
The syntax of the oct() method is as follows:
oct(integer) |
where Integer is the value that will be converted to the octa string
Example
In the example below, we will convert an integer into its octal value
my_integer= 100 |
Output
This code will display the octal value of 100.
Article Contributed By :
|
|
|
|
243 Views |