Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import sys def dec2any(n, b): if (n == 0): return r = n % b; n = (n - r) // b; if (r <
import sys def dec2any(n, b): if (n == 0): return r = n % b; n = (n - r) // b; if (r < 0): n += 1 dec2any(n, b) if (r < 0): print(r + (b * -1),end='') else: print(r,end='') return def main(): base = int(sys.argv[1]) n = int(input('Enter the decimal value: ')) if n!=0: dec2any(n,base) else: print(0) main()
how would i change the int to read as a float so when i have a base 60 trying to convert .5 it should convert to.30
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started