Question: Implement a function named stringCounter() that gives the user the ability to enter an arbitrary number of strings and tracks how many times the same

 Implement a function named stringCounter() that gives the user the ability

Implement a function named stringCounter() that gives the user the ability to enter an arbitrary number of strings and tracks how many times the same string was entered. The function returns a dictionary with the string and count of occurrences. The user exits the function by typing the letter 'X' and hitting enter. >>> stringCounter() Please enter a value: one Please enter a value:cat Please enter a value: cat Please enter a value: dog Please enter a value: test Please enter a value: Please enter a value: X ('': 1, 'dog': 1, 'test': 1, 'cat':2, 'one':1} >>> stringConter() Please eater a value: bird Please eater a value: bird Please eater a value: dog Please eater a value: dog Please eater a value: cat Please eater a value: cat Please enter a value: X ('dog': 2, 'bird': 2, 'cat':2}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!