I'm trying to write code that will take any decimal value and then convert it to any input base.
I've created an infinite loop and I've read through suggested similar questions but I just cannot work it out.
Any assistance would br really appreciated, I'm a major python rookie (obviously).
decimal = int(input("Enter a decimal number to be converted: "))
new_base = int(input("Enter the base you wish to convert to: "))
def base_conversion(decimal, new_base):
output = []
quotient = -1
while quotient != 0:
remainder = decimal % new_base
quotient = int(decimal / new_base)
output.insert(0, remainder)
return output
result = output
print(result)
base_conversion(decimal, new_base)