Convert Decimal Number to Octal String using Python

oct function

decimalNumber = 40
octalString = oct(decimalNumber).replace('0o', '')

print(octalString)

Leave a Comment

Cancel reply

Your email address will not be published.