Out print binary format int values from a bitwise "AND" operation.
ip = int('11100001', 2) mask = int('11000000', 2) print("{0:b}".format(ip&mask))
Result is:
11000000