Octal numbers have a base of eight and the digits 0–7. Write thescripts octalToDecimal.py and decimalToOctal.py,which convert numbers between the octal and decimal representationsof integers.
These scripts use algorithms that are similar to those of thebinaryToDecimal and decimalToBinary scriptsdeveloped in the Section: Strings and Number Systems.
An example of octalToDecimal.py input andoutput is shown below:
Enter a string of octal digits: 234
The integer value is 156
An example of decimalToOctal.py input andoutput is shown below:
Enter a decimal integer: 27 Quotient Remainder Octal 3 3 3 3 33 The octal representation is 33 Show transcribed image text Enter a decimal integer: 27 Quotient Remainder Octal 3 3 3 3 33 The octal representation is 33
Expert Answer
Answer to Octal numbers have a base of eight and the digits 0–7. Write the scripts octalToDecimal.py and decimalToOctal.py, whic…