Python oct() function

The oct() function in Python converts an integer number to an octal string prefixed with “0o”.

Syntax

Parameter

x: This parameter represents an Integer Number

Return

This function returns an octal string.

Example 1

Output

Example 2

Output

 

Pin It on Pinterest

Share This