How can i remove the spaces in output please provide me the proprler answer
Word Count - 2
Given a sentence S, write a program to print the frequency of each word in S, where words are sorted in alphabetical order.
Input
The input will be a single line containing a string S.
1
Expert's answer
2021-09-08T16:10:37-0400
n = input('Enter string here: ')
n_list = n.split(' ')
unique_list = sorted(set(n_list))
for i in unique_list:
print(i, n_list.count(i))
Enter string here: i am a boy am
a 1
am 2
boy 1
i 1
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment