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
A system of economics in which producers and consumers make their own decisions to meet their needs and wants.
seraphim [82]

Answer:

In a market economy, the private-sector businesses and consumers decide what they will produce and purchase, with little government intervention. ... In a mixed economy both market forces and government decisions determine which goods and services are produced and how they are distributed.

Explanation:

4 0
3 years ago
Which of these agricultural factors has been called cotton's "greatest enemy"?
gladu [14]

The correct answer is boll weevil

Boll Weevils are a small beetle that feeds on grains, such as wheat and rice. There are several types of weevils. And it is "greatest enemy" for cotton because it can invade the pantry or a plantation and make an infestation occurs.

6 0
3 years ago
2) How have human rights movements reshaped political, social, and economic
Jobisdone [24]

Answer:

The declaration has spawned other important treaties against racial, gender, and ability discrimination. Now 198 countries allow women to vote, compared to 91 in 1948, 57 per cent of countries have a human rights institution and 111 countries have adopted press freedom laws.

Explanation:

marek brileint

6 0
3 years ago
Read 2 more answers
WHAT DI THE TERM BRED AND CIRCUSES REFER TODURING THE TIME OF ROMAN EMPORERRS
astra-53 [7]
The term is 22.6.7.5.4
8 0
3 years ago
Cuando colon descubrio america?​
alexandr402 [8]

Answer:

Es el día en que Cristóbal Colón completó su viaje a través del Océano Atlántico y llegó al “Nuevo Mundo”.

Explanation:

El 12 de octubre 1492, es una fecha de enorme importancia en la historia de Occidente

4 0
3 years ago
Read 2 more answers
Other questions:
  • WE DID IT!!!!!!!!<br> I BARELY PASSED MY HISTORY EXAM!!!!!!!!
    8·2 answers
  • In 50 words, describe how each political party represented different needs and desires of people in the states. Do you think tha
    9·2 answers
  • Scarcity exists when there are resources to meet unlimited needs and wants. Because of , we must make choices about how to use r
    8·2 answers
  • Almost ______________ million soldiers were killed in battle during World War I.
    8·1 answer
  • What major orbital problem of the late 1800s is solved by general relativity?
    14·1 answer
  • What were the goals of the Chinese revolution (1949)?
    6·2 answers
  • write an argumentative paragraph in response to the prompt. Give your answer in the form of at least four to six sentences, and
    12·2 answers
  • The demand for major constitutional reforms led a conflict between what two major elements of English government?
    12·1 answer
  • In an essay, explain which emperor had the greatest impact on the roman empire.
    8·1 answer
  • (PLEASE DONT SEARCH UP ON GOGLE ESPECIALLY WIKIPEDI) HELP!!!!!!!!!!!!(15pts)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!