Question: Question # 2 : to _ decimal ( oct _ num ) 1 0 pts Given a number oct _ num in octal system (
Question #: todecimaloctnum pts
Given a number octnum in octal system base return octnum in decimal system base In
the octal number system, each digit represents a power of eight and it uses the digits to To
convert a number represented in octal system to a number represented in decimal system, each
digit must be multiplied by the appropriate power of eight. For example, given the octal number
results in the decimal number :
You are NOT allowed to type convert num to a string use lists in any form, add
the digits into a list to traverse or process the number, or to use of the math module
Preconditions and Postconditions
octnum: int Positive number that always starts with a digit in range
Returns: int decimal representation of octnum
Example:
todecimal #
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
