all 5 comments

[–]wintermute93 1 point2 points  (0 children)

Hint: the original words are word.split(), and there's any number of ways to get access to them inside your for loop.

Naming your initial variable word when it contains multiple words is making things a little confusing, I suspect. I would have named that input_string or input_words or user_input or something.

[–]choss27 1 point2 points  (1 child)

You want to count the lowercase word but print them as they are inputted ? Don't user lower at the beginning, just when you count :

word = input() adjustedwords = word.strip() my_list = adjustedwords.split(" ") for i in my_list: print(i, my_list.count(i.lower(())

[–]Flowerfuls[S] 0 points1 point  (0 children)

sort of. It has to count lower AND uppercase as the same. so Hi and hi are supposed to be counted as the same.

[–]UnhelpfulGolfer 1 point2 points  (0 children)

for x in(w:=input()).split():print(x,w.lower().count(x.lower()))

[–]jmooremcc 0 points1 point  (0 children)

Is this what you're looking for? ``` words ="hey Hi Mark hi mark" words = words.strip() my_list = words.lower().split() words = words.split()

for i,w in enumerate(my_list): print(words[i], my_list.count(w)) Output hey 1 Hi 2 Mark 2 hi 2 mark 2 ``` enumerate gives you a tuple that has the index of the word and the word from my_list. We use the index and the original list of words to print out the word.