Q:

Write a Python program to find the most common elements and their counts of a specified text

0

Write a Python program to find the most common elements and their counts of a specified text

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

from collections import Counter
s = 'lkseropewdssafsdfafkpwe'
print("Original string: "+s)
print("Most common three characters of the said string:")
print(Counter(s).most_common(3))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now