Base Conversion In Python Code