Create a dictionary called lett_d that keeps track of all of the characters in the string product and notes how many times each character was seen. Then, find the key with the highest value in this dictionary and assign that key to max_value.
product = "iphone and android phones"
lett_d={ }
for c in product:
if c not in lett_d:
lett_d[c]=0
lett_d[c]=lett_d[c]+1
#print(lett_d)
ks=lett_d.keys()
max_value=list(ks)[0]
#print(max_value)
for k in ks:
if lett_d[k] > lett_d[max_value] :
max_value=k
print("key " + max_value + " has the highest value: " + str(lett_d[max_value]))