Menu

[Solved]-Trouble Creating Prompt Python Understand Make Using Built Functions However Asked Solved Q37255547

Write a function convert(n, b) that converts an integer n to base b and returns the result as a string. For example, convert(

Having trouble creating this prompt in Python. I understand howto make it using built in functions, however it is asked to besolved without built in functions.

Need to convert to and from: binary, dec, and hex numbersystems.

Write a function convert(n, b) that converts an integer n to base b and returns the result as a string. For example, convert(23, 2) should return “1011 1″ while convert(23, 16) should return “17″. By comparison, convert(31, 2) should return “11” while convert(31, 16) should return “1F”. Show transcribed image text Write a function convert(n, b) that converts an integer n to base b and returns the result as a string. For example, convert(23, 2) should return “1011 1″ while convert(23, 16) should return “17″. By comparison, convert(31, 2) should return “11” while convert(31, 16) should return “1F”.

Expert Answer


Answer to Having trouble creating this prompt in Python. I understand how to make it using built in functions, however it is asked… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *