Question: Write a program that prompts the user for a phrase. Once the program captures the phrase, it calls a function, count_characters which receives the phrase

Write a program that prompts the user for a phrase. Once the program captures the phrase, it calls a function, count_characters which receives the phrase as its only argument. The function calls another function called is_letter which returns true if the character passed to it is an upper or lower case letter. If the is_letter returns true increment the count of letters.

The main program needs to display a message stating how many letters were in the phrase. Also, the program needs to prompt the user if they would like to enter another phrase. If the user enters 'y' or "y' the program runs again. Please see sample output below.

Note: you need to write these functions even though though there may be equivalent buil- in functions in Python. 

SAMPLE OUTPUT

Enter a phrase: This is a test
there are 11 letters in this phrase
Would you like to test another phrase?
Enter Y or any other character for no: n
Have a nice day!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Python code def ... 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!