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 

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

1 Expert Approved Answer
Step: 1 Unlock

Python Get a string from the user inputstring inputPlease en... View full answer

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 Programming Questions!