Binary To Decimal Conversion Function In Python