Question: Write a Python program to get a string from the user, and count the number of letters (a-z or A- Z), digits (0-9), spaces,
Write a Python program to get a string from the user, and count the number of letters (a-z or A- Z), digits (0-9), spaces, and other characters. The prompt should be "Please enter a string: " The output should be formatted as "There are {:d) letters, {:d) digits, (:d) spaces, and (:d) other characters. The length of the string is (:d)." NOTE: you should strictly follow the prompt/output format to get full marks. Example1 (The contents highlighted by brown ink are inputs from the user): Please enter a string: I have a keyboard with 87 keys. There are 22 letters, 2 digits, 6 spaces, and 1 other characters. The length of the string is 30. Example2 (The contents highlighted by brown ink are inputs from the user): Please enter a string: Nothing is impossible There are 19 letters, 0 digits, 2 spaces, and 0 other characters. The length of the string is 21.
Step by Step Solution
3.47 Rating (150 Votes )
There are 3 Steps involved in it
Python Get a string from the user inputstring inputPlease en... View full answer
Get step-by-step solutions from verified subject matter experts
