To store the frequency of characters of string str3
freq = { } NEW_LINE for i in range ( len ( str3 ) ) : NEW_LINE INDENT if ( freq . get ( str3 [ i ] ) == None ) : NEW_LINE INDENT freq [ str3 [ i ] ] = 1 NEW_LINE DEDENT else : NEW_LINE INDENT freq . get ( str3 [ i ] , 1 ) NEW_LINE DEDENT DEDENT