Loop to compute the frequency
for i in range ( 0 , n ) : NEW_LINE INDENT if a [ i ] in frequency : NEW_LINE INDENT frequency [ a [ i ] ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT frequency [ a [ i ] ] = 1 NEW_LINE DEDENT DEDENT