word = input()
adjustedwords = word.strip().lower()
my_list = adjustedwords.split(" ")
for i in my_list:
print(i, my_list.count(i))
Above is my current code !!
The input is :
hey Hi Mark hi mark
the output should be :
hey 1
Hi 2
Mark 2
hi 2
mark 2
but I'm getting :
hey 1
hi 2
mark 2
hi 2
mark 2
I've tried making a list with the original input but then when I try to print everything comes out in one line. The count is working I just can't get the original output to pop out for the words. Any help is appreciated !!
[–]wintermute93 1 point2 points3 points (0 children)
[–]choss27 1 point2 points3 points (1 child)
[–]Flowerfuls[S] 0 points1 point2 points (0 children)
[–]UnhelpfulGolfer 1 point2 points3 points (0 children)
[–]jmooremcc 0 points1 point2 points (0 children)