Number System Conversion written in Python