1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vlada [557]
2 years ago
6

Write a program that reads a one-line sentence as input and then displays the following response: If the sentence ends with a qu

estion 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 amount of characters, display the word No. If the sentence ends with an exclamation point, display the word Wow. In all other cases display the words You always say followed by the input string enclosed in quotes
History
1 answer:
Nastasia [14]2 years ago
5 0

The program is an illustration of conditional statements

<h3>What are conditional statements?</h3>

Conditional statements are statements used to make decisions

<h3>The main program</h3>

The program written in Python, where comments are used to explain each action is as follows:

#This gets the input for the sentence

sentence = input("Word: ")

#This counts the number of characters

countChar = len(sentence)

#The following if conditions print the required output from the test conditions

if(sentence[-1] == "?" and countChar%2 == 0):

   print("Yes")

elif(sentence[-1] == "?" and countChar%2 == 1):

   print("No")

elif(sentence[-1] == "!"):

   print("Wow")

else:

   print("Nice",sentence)

Read more about conditional statements at:

brainly.com/question/24833629

You might be interested in
What is one feature of Mohenjo-Daro that represents an advance over techniques used in other contemporaneous cultures?
Finger [1]

Answer:

Advanced urban planning.

Explanation:

Hello!

Mohenjo-Daro is located on the banks of the Indus River, in the current territory of Pakistan.  It was one of the most important cities inhabited by the Indus Valley culture, known as Harappa culture.

The Mohenjo-Daro archeological site reveals that the city's organization was planned.

The city had two zones. The first area contained the citadel, in which the administrative and religious buildings were located. The citadel is elevated on an artificial mound. The second area  was composed of residential buildings and several craft workshops.

Success in your homework!

5 0
3 years ago
What states wanted qual representation in the congress vote?
labwork [276]

Large states felt that they should have more representation in Congress, while small states wanted equal representation with larger ones. ... This created a bicameral legislative branch, which gave equal representation to each State in the Senate, and representation based on population in the House.

8 0
3 years ago
How did the yuan dynasty contribute to the rebellion that eventually overthrew the dynasty
marishachu [46]
The answer to your question is: The emperors had lacked the leadership skills to rule the dynasty and the officials were also corrupt. Because of the corruption and mismanagement of the dynasty, a certain group led by Zhu Yuangzhang went against the dynasty and caused the fall.
4 0
3 years ago
Read 2 more answers
When working on the drafting of the new Constitution, the conflicts boiled down to 3 major issues. From the options below what w
svet-max [94.6K]

Answer:

the first two and the last one they didnt care bout till later

7 0
3 years ago
Read 2 more answers
Hardest Riddle do you got what it takes
yuradex [85]

Answer:

"What side did your brother say?"

To explain, one of the twins lied and one told the truth. The one who lied would say what the other twin said (The truth) and vice versa. Then, you will know which one is the right path!

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which issue deteriorated race relations in 1919? Watts Riots Plessy v. Ferguson John Brown’s Raid Red Summer
    7·1 answer
  • 6. Michelle just graduated from the university and studied to be a teacher. She is now going to work helping pre school children
    14·2 answers
  • Beginning in 1899, the open door policy increased trade between the united states and which nation? answers
    13·1 answer
  • Help!!
    11·1 answer
  • How does impressionist painting differ from realist painting?​
    9·1 answer
  • What was the Marshall Plan, and what did it accomplish?
    8·2 answers
  • How could you use this document to argue that Rome had a better system of citizenship than Athens?
    5·1 answer
  • 11. China's Belt and Road Initiative is about building
    7·1 answer
  • Question 1 of 10
    6·1 answer
  • In what way did characters in European Renaissance literature NOT differ from characters in medieval literature
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!