Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8. What are the advantages and disadvantages of iSCSI?

Answered: 1 week ago

Question

Understand the primary objectives of performance appraisals

Answered: 1 week ago