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 the text " explores" mostly about
Juli2301 [7.4K]
You need to show us what text your talking about
7 0
3 years ago
Read 2 more answers
Which term means to keep the peace by giving in to someone's demands?
evablogger [386]

It's D. appeasement

6 0
3 years ago
Read 2 more answers
To reduce inflation, the Federal Reserve _____ the money supply. This action also causes the economy to shrink.
igor_vitrenko [27]

Answer:

decreases

Explanation:

To reduce inflation, the Federal Reserve decreases the money supply. This action also causes the economy to shrink.

Hope this helps!

Feel free to ask if you have anymore questions!

5 0
3 years ago
In witch two island did the portuguese have their suger plantaions?
Dafna11 [192]

Madeira and Cape Verde

Hope this helped

Cody

3 0
3 years ago
Read 2 more answers
In the trade network American colonies depend on England for
Bond [772]

In the trade network, the American colonies depended on the British for finished goods and products. The colonies were responsible for exporting raw materials such as sugar, tobacco, indigo, etc to England

8 0
3 years ago
Other questions:
  • _____ is the largest Mayan ruin; it contains one of the tallest structures in Pre-Columbian America.
    11·1 answer
  • What did the search for a primordial "Ur language" lead to?
    12·1 answer
  • Which international organization provides loans at cheap rates to developing countries?
    8·1 answer
  • The land ordinance of 1785 encouraged a certain type of settler by __________.
    9·1 answer
  • The imaginary line of secrecy and mistrust that separated the USSR and Eastern Europe from the West was known as:
    13·1 answer
  • Primarily Mexican population centers in U.S. cities were called barrios.<br> True<br> Ralse
    9·2 answers
  • Who makes up the house of representatives
    8·2 answers
  • Has the U.S foreign policy been good for the world ? Why or why not
    9·1 answer
  • Joe McCarthy would bring individuals
    6·2 answers
  • 1. How does James Joyce’s work reflect disillusionment of the post-war period?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!