Replaced binary function by Python's binary formatting

Python supports conversion to binary by using the `b` formatter.