My Coding >
Programming language >
Python >
Exercise >
Python: How to convert integer to string in any base
Python: How to convert integer to string in any baseint to str with base < 36It is very easy to convert integet to a string with any base, but this example will only work with base below an alphabet length. If you need to have bigger basem it is possible to use bigger alphabet, or use list structure to keep every digit separately
int to str with base >= 36If the base is bigger than alphabet, then we need to have other way to store and display it. We can use similar system which used for time representation (base = 60)
|
Last 10 artitles
9 popular artitles
|
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |