We use if-else structure to check if the sentence meets the requirements for each situation.
Comments are used to explain each line of the code.
#get the user input
sentence = input("Enter a sentence: ")
#check if the sentence ends with ? and has even number of characters
if sentence.endswith("?") and len(sentence) % 2 == 0:
print("Yes")
#check if the sentence ends with ? and has odd number of characters
elif sentence.endswith("?") and len(sentence) % 2 == 1:
print("No")
#check if the sentence ends with !
elif sentence.endswith("!"):
print("Wow")
#used for other situations
else:
print("You always say \"{}\"".format(sentence))
You may see a similar question at:
https://brainly.com/question/14851610