Answer :
Answer:
def wordsOfFreqency(words, freq):
text1 = "Apple apPLE mangO aPple orange Orange apple guava Mango mango"
words = []
words1 = []
words1 = text1.split()
words = [x.upper() for x in words1]
freq=[words.count(w) for w in words]
print(dict(zip(freq,words)))
return words
def main():
wordsOfFreqency(words, freq)
if __name__=="__main__":
main() # call main function
Explanation:
This will print the list of strings as per its word frequency.
Output is :
{4: 'APPLE', 3: 'MANGO', 2: 'ORANGE', 1: 'GUAVA'}