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
Need a little help please
WINSTONCH [101]

Answer:  the county of Edessa (1097–1150); the principality of Antioch (1098–1287) this is for number 2

1. When Pope Urban had said these and very many similar things in his urbane discourse, he so influenced to one purpose the desires of all who were present that they cried out, ‘It is the will of God! It is the will of God!’’’

So wrote the monk Robert of Rheims in his Historia Hierosolymitana (‘History of Jerusalem’) during the early 1100s. Some years earlier, on 27 November 1095, Urban II preached a public sermon outside the town of Clermont in central France, summoning Christians to take part in the First Crusade, a new form of holy war. It was a carefully stage-managed event, in which the pope’s representative, the papal legate Adhémar of Le Puy, supposedly moved by the pope’s eloquence, tore up strips of cloth to make crosses for the crowds. Urban had been travelling through France accompanied by a large entourage from Italy, dedicating cathedrals and churches and presiding over reforming councils, and his proposed crusade was part of a wider programme of church reform. In March that year, at the Council of Piacenza, a desperate Byzantine emperor, Alexius I Comnenus, had pleaded for western help against the Seljuk Turks, whose conquests were decimating Byzantium and preventing Christians from reaching pilgrimage sites. Urban wanted to extend the hand of friendship to the Orthodox church and to heal the schism with Catholicism, which had gone from bad to worse since the time of his predecessor Leo IX.

We have a number of accounts of Urban’s speech, contemporary and later, although they differ somewhat in what they record. Yet we know that he called on knights to vow to fight in a penitential pilgrimage on Christ’s behalf, in a war to defend the Holy Land from Muslim oppressors, and that he used the Christian symbol of the cross as an emotive sign of commitment to the enterprise. Urban promised the crowds that crusading would not just benefit the church and European Christian society but their own souls, since all sins, past and present, would be wiped away through his dramatic promise of the ‘remission of sins’.

Explanation:

4 0
2 years ago
Progressives, such as Woodrow Wilson, supported financial reforms because they believed the nation’s financial system was overly
ra1l [238]

Progressives, such as Woodrow Wilson believed the nation’s financial system was overly controlled by <u>big businesses.</u> Therefore, the correct statement is Option D.

<h3>Who was  Woodrow Wilson?</h3><h3> </h3>

Thomas Woodrow Wilson became an American politician and educator who served as the twenty-eighth president of the US from 1913 to 1921.

A member of the Democratic Party, Wilson served as the president of Princeton University and the governor of New Jersey earlier than prevailing in the 1912 presidential election.

Therefore, Progressives, such as Woodrow Wilson believed the nation’s financial system was overly controlled by <u>big businesses.</u> the correct statement is Option D.

learn more about  Woodrow Wilson:

brainly.com/question/4112868

#SPJ1

5 0
2 years ago
How did Filipino rebels get involved in the Spanish-American War?
const2013 [10]

The correct answer is Option D) They supported the United States, hoping for independence.



The United States entered overseas war against the Spanish in the American-Spanish war which lasted from 1898 to 1902 and eventually turned into the American-Filipino war.



Before the arrival of the Americans, Philippines had been annexed and become a colony of Spain.


When the American-Spanish war started many Filipino rebels actually supported the American war effort in the hopes that the Spanish defeat would lead to their independence.


This however, did not happen as the Philippines eventually became an American colony.

6 0
3 years ago
Read 2 more answers
One of the main reasons John D. Rockefeller was able to succeed in the oil industry was because he
ser-zykov [4K]
<span>When examining how Rockefeller became successful, notice that he owned absolutely everything regarding the production and transportation. This means that the answer is C) Combined vertical and horizontal integration. He became a monopoly owner meaning he owned everything regarding the production of oil and didn't rely on anyone.</span><span />
5 0
3 years ago
Read 2 more answers
The winner of the most votes in the primary election will represent his or her party in the general election as the __________.
Dima020 [189]

Answer:

nominee

I did the test

8 0
2 years ago
Other questions:
  • What object was found in tutankhamun’s that suggest there was a curse
    11·1 answer
  • About how long was california a part of mexico before it became a u.s. state?
    14·1 answer
  • Select the FOUR true statements about the third English expedition to the new world:
    13·1 answer
  • Which of the following documents was important to convincing the American Colonists to break away from Britain?
    5·2 answers
  • Why was Rhode Island founded
    8·1 answer
  • These lines from the declaration of independence are an example of the use of _______________.
    15·1 answer
  • Which of Marx and Engle's ideas were influencial in the 1917 Russian Revolution? Choose all correct reponses. They wrote of a so
    10·2 answers
  • 5.03 beginnings of Roman culture
    11·1 answer
  • PLease HElp MeHHHHHHHHHHHHHHHHHH rlly need the help ill mark brainiest for people that help meh
    12·1 answer
  • What does<br> King say are the effects of segregation?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!