How to use Python to convert an octal to a decimal
I have this little homework assignment and I needed to convert decimal to octal and then octal to decimal. I did the first part and can not figure out the second to save my life. The first part went like this: decimal = int(input("Enter a decimal integer greater than 0: ")) print("Quotient Remainder Octal") bstring = " " while decimal > 0: remainder = decimal % 8 decimal = decimal // 8 bstring = str(remainder) + bstring print ("%5d%8d%12s" % (decimal, remainder, bstring)) print("The octal representation is", bstring) I read how to convert it here: Octal to Decimal but have no clue how to turn