To convert octal to decimal number in python, you have to ask from user to enter a number in octal number system to convert it into decimal number to display the equivalent number in decimal format as shown in the program given below.
Following python program ask from user to enter any number in octal number system to convert it into decimal number:
# Python Program - Convert Octal to Decimal while True: print("Enter 'x' for exit.") octal = input("Enter number in Octal Format: ") if octal == 'x': break else: decimal = str(int(octal, 8)) print(octal,"in Decimal =",decimal,"\n")
Here is the sample run of the above Python program demonstrating how to convert octal number to decimal number:
You may also like to learn or practice the same program in other popular programming languages: