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
The united states has had a trade deficit over the past two decades because the nation
Kryger [21]
<span>The United States have had a trade deficit over the past two decades because the nation had a persistent trade deficit. Since the 1970s, The United States had entered into a trade deficit, from trade surplus. This started because Japan and Europe started trading and competing with US, in a range of industries.</span>
3 0
3 years ago
A group of workers is tired of having to work 10-hour days. They gather together on their time off outside of their work place a
Nookie1986 [14]
Yes. they were protest peacefully if they were vilent it would be no.
8 0
3 years ago
Read 2 more answers
The American ships and planes were in a peacetime condition of readiness, not geared for attack. The guns were without ammunitio
slamgirl [31]

Answer:

It will have a negative effect on hand success.

Explanation:

The strength of a war is seen from the readiness and availability of sophisticated weapons by the party involves.

Hand succes is hardly achieved in war in this our dispensation and Time. More tedious works cannot be achieved by hand success. Distance communication will be crippled without applying technology.

5 0
3 years ago
Read 2 more answers
How was the clothing of rich people different from the peasants clothing in the incas?
mylen [45]

Answer:

The women wore long dresses. Both men and women would wear capes or ponchos to keep them warm during the winter. The peasants and the nobles wore similar fashions. Of course the clothing of the rich was made from finer cloth and was more decorated.

Explanation:

5 0
2 years ago
Read 2 more answers
3. What did a letter signed by world-famous scientist Albert Einstein communicate to
astraxan [27]

Answer:

I think the letter was about the first atomic bomb.

Explanation:

''The Einstein–Szilárd letter was a letter written by Leó Szilárd and signed by Albert Einstein that was sent to the United States President Franklin D. Roosevelt on August 2, 1939. ... It prompted action by Roosevelt, which eventually resulted in the Manhattan Project developing the first atomic bombs.''

got the explanation from wikipedia, hope this helps.

4 0
3 years ago
Other questions:
  • How did the United States extend its influence in Asia<br> (need multiple answers)
    8·1 answer
  • What country did Texas win it’s independence from
    10·1 answer
  • What happened to the USS Cole after it was the subject of a terrorist attack in 2000? It sank in the Gulf at the Yemeni port of
    8·1 answer
  • If the amplitude of the resultant wave is twice as great as the amplitude of either component wave, and this wave exhibits reinf
    14·1 answer
  • What lead to the distancing of the employee and the employer?
    14·1 answer
  • Mengapakah pejabat India ingin menjadikan mata wang rupee India sebagai mata wang?​
    15·1 answer
  • How did Ronan's use science and mathematics to improve the lives of the Roman people ?
    9·1 answer
  • Money is shared out between Paul and Helen in the ratio of 3:4 Helen receives £16 How much did Helen receive
    12·1 answer
  • He First Continental Congress was held in response to the:
    15·2 answers
  • 3. What was the original purpose of The Federalist Papers?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!