Iterate both the strings and count the number of occurrences of
for i in range ( len ( s1 ) ) : NEW_LINE INDENT if ( s1 [ i ] == '0' ) : NEW_LINE INDENT s1_0 += 1 NEW_LINE DEDENT if ( s2 [ i ] == '0' ) : NEW_LINE INDENT s2_0 += 1 NEW_LINE DEDENT DEDENT