Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!