Question: In Python: Write a program that reads a one-line sentence as input from the user and then displays the following response: If the sentence ends

In Python:

In Python: Write a program that reads a one-line sentence as input

Write a program that reads a one-line sentence as input from the user and then displays the following response: If the sentence ends with a question mark (?) and the input contains an even number of characters, display the word Yes. If the sentence ends with a question mark(?) and the input contains an odd number of characters, display the word No. If the sentence ends with an exclamation point (1), display the word Wow. In all other cases, display the words You always say followed by the input string enclosed in quotes. You must implement the function evenCharacters (myString). It will return True if the number of characters in myString is even and False otherwise. This function is defined outside the "if name equals main" block

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!