Write a FUNCTION that asks the user to input a string. Unless the user inputs "END" or "end", a loop will execute wherein the user is asked to input a string. Each time the loop runs and the user input a string, the function does the following: +Print the number of letters in the string that the user inputs; +Print the number of digits in the string that the user inputs. When the user enters "END" or "end" the loop stops and the function prints the aggregate numbers of letters and digits that the user has entered from the beginning. Example: 1st loop: a8K6H => 3 letters and 2 numbers 2nd loop: THGF*T425 => 5 letters and 3 numbers Aggragates: 8 letters and 5 numbers
1) Write a FUNCTION that asks the user to input a string.
Unless the user inputs "END" or "end", a loop will execute wherein the user is asked to input a string. Each time the loop runs and the user input a string, the function does the following:
+Print the number of letters in the string that the user inputs;
+Print the number of digits in the string that the user inputs.
When the user enters "END" or "end" the loop stops and the function prints the aggregate numbers of letters and digits that the user has entered from the beginning.
Example:
1st loop: a8K6H => 3 letters and 2 numbers
2nd loop: THGF*T425 => 5 letters and 3 numbers
Aggragates: 8 letters and 5 numbers
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images