Python Data Structures and Algorithms - Recursion: Convert an integer to a string in any base
2. Integer to String Conversion in Any Base Using Recursion
Write a Python program to convert an integer to a string in any base using recursion.
Sample Solution:
Python Code:
Sample Output:
B13
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to convert a positive integer to a string in a given base (2–36) recursively.
- Write a Python program to implement a recursive function that converts negative integers to their string representation in any base.
- Write a Python program to convert an integer to its base-n representation using tail recursion.
- Write a Python program to recursively convert an integer to a string in any base and output the result in uppercase for bases above 10.
Go to:
Previous: Write a Python program to calculate the sum of a list of numbers.
Next: Write a Python program of recursion list sum.
Python Code Editor:
Contribute your code and comments through Disqus.
What is the difficulty level of this exercise?
Based on 68 votes, average difficulty level of this exercise is Hard
.
Test your Programming skills with w3resource's quiz.