im trying for a program that can recive a text, looks into it and give me the worlds on chains or characters where it finds it most(for example the text is:"Hellooo how are you :)?" and would send that 'Hellooo' is the chains of characters with most 'o' in the text. and it needs to be a dictionary, like {'o': Hellooo}
def x(text):
y = str(input('which character you looking'))
z = (text.count(y))
dic = {y : z}
print(dic)
i did a quick code that can counts the amount of character you ask for in the text, but i wanna know a way to make it read the chains of character or phrase separately, so it could count the amount of it by each chain or phrase in the text