bynary to decimal code optimisation PEP-8 style