function for converting binary string into integer value
def binStrToInt ( binary_str ) : NEW_LINE INDENT length = len ( binary_str ) NEW_LINE num = 0 NEW_LINE for i in range ( length ) : NEW_LINE INDENT num = num + int ( binary_str [ i ] ) NEW_LINE num = num * 2 NEW_LINE DEDENT return num / 2 NEW_LINE DEDENT