{"id":19162,"date":"2021-08-29T15:13:51","date_gmt":"2021-08-29T09:43:51","guid":{"rendered":"https:\/\/python-programs.com\/?p=19162"},"modified":"2021-11-22T18:37:08","modified_gmt":"2021-11-22T13:07:08","slug":"python-program-to-convert-octal-to-decimal-using-while-loop","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-convert-octal-to-decimal-using-while-loop\/","title":{"rendered":"Python Program to Convert Octal to Decimal using While Loop"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Convert Binary to Decimal using While Loop<\/a>
\nGiven an octal number and the task is to get the respective decimal number using the while loop in Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Octal Number = 15<\/pre>\n

Output:<\/strong><\/p>\n

The Decimal value of the given Octal number { 15 } is: \r\n13<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Octal Number = 32<\/pre>\n

Output:<\/strong><\/p>\n

The Decimal value of the given Octal number { 32 } is: \r\n26<\/pre>\n

Program to Convert Octal to Decimal in Python<\/h2>\n

Below are the ways to convert the given octal number into decimal :<\/p>\n