Binary to decimal: The question is about converting a string

The question is about converting a string of decimal digits to binary . There is no decimal in this answer. You are just converting a binary integer to printable binary . @NilutpalBorgohain It found that this will convert the integer n to its binary with 8 binary digits. What if I want to do this at run time and not at compile time? 0 The Python package Binary Fractions has a full implementation of binaries as well as binary fractions. You can do your operation as follows: from binary_fractions import Binary b = Binary (6) # Creates a binary fraction string b.lfill(8) # Fills to length 8 This package has many other methods for manipulating binary strings with full precision. I'd simply like to convert a base-2 binary number string into an int, something like this: >>> '11111111'.fromBinaryToInt() 255 Is there a way to do this in Python?

₹ 172.000
₹ 420.000 -18%
Quantity :