1 # Put your code here In convert.py, define a function decimalToRep that 3 # A main for testing your program 4 def main(): returns the representation of an integer in a given base. II I|"Tests the...


Must be written in Python.


1 # Put your code here<br>In convert.py, define a function decimalToRep that<br>3 # A main for testing your program<br>4 def main():<br>returns the representation of an integer in a given base.<br>II I|

Extracted text: 1 # Put your code here In convert.py, define a function decimalToRep that 3 # A main for testing your program 4 def main(): returns the representation of an integer in a given base. II I|"Tests the function.""" print(decimalTORep(10, 10)) print(decimalTORep(10, 8)) print(decimalToRep(10, 2)) print(decimalToRep(10, 16)) • The two arguments should be the integer and the base. 7 • The function should return a string. 8. 9. • It should use a lookup table that associates integers 10 with digits. 11 # The entry point for program execution 12 if --name_- "-_main__": A main function that tests the conversion function with 13 main() 14 numbers in several bases has been provided. An example of main and correct output is shown below: def main(): I""Tests the function.""" print(decimalToRep(10, 10)) print(decimalTORep(10, 8)) print(decimalTORep(10, 2)) print(decimalTORep(10, 16)) 10 12 1010 A

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here