Step 2: Screenshot #Prompt the user to enter input string print ("Enter input:") #Get the input string and store it into a variable sentence = input () #Split the input string into words by space list = sentence.split() print ("\nOutput:") #Iterate through words in the list for word in list: #Get the count for each word num =list.count (word) #Print word and their frequencies print (word,num) Step 3: Output Enter input: hey hi Mark hi mark Output: hey 1 hi 2 Mark 1 hi 2 mark 1 ..Program finished with exit code 0

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question
令l.
16:56
Q SEARCH
& ASK 탄 CHAT
VX MATH SOLV
Step 2: Screenshot
#Prompt the user to enter input string
print ("Enter input:")
#Get the input string and store it into a variable
sentence = input ()
#Split the input string into words by space
list = sentence.split()
print ("\noutput:")
#Iterate through words in the list
for word in list:
#Get the count for each word
num =list.count (word)
#Print word and their frequencies
print (word, num)
->
Step 3: Output
Enter input:
hey hi Mark hi mark
Output:
hey 1
hi 2
Mark 1
hi 2
mark 1
...Program finished with exit code o
bartleby.com A
EE
Transcribed Image Text:令l. 16:56 Q SEARCH & ASK 탄 CHAT VX MATH SOLV Step 2: Screenshot #Prompt the user to enter input string print ("Enter input:") #Get the input string and store it into a variable sentence = input () #Split the input string into words by space list = sentence.split() print ("\noutput:") #Iterate through words in the list for word in list: #Get the count for each word num =list.count (word) #Print word and their frequencies print (word, num) -> Step 3: Output Enter input: hey hi Mark hi mark Output: hey 1 hi 2 Mark 1 hi 2 mark 1 ...Program finished with exit code o bartleby.com A EE
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning