0

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

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 13 '22 at 15:13

0 Answers0