Answers for "Python code that takes a string and prints the letters in decreasing order of frequency."

0

Python code that takes a string and prints the letters in decreasing order of frequency.

#Code By Mark Thankappan
W= input('Please enter a string ')
def most_frequent(string):
    d = dict()
    for key in string:
        if key not in d:
            d[key] = 1
        else:
            d[key] += 1
    return d

print (most_frequent(W))
Posted by: Guest on January-05-2021

Code answers related to "Python code that takes a string and prints the letters in decreasing order of frequency."

Python Answers by Framework

Browse Popular Code Answers by Language