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]
3 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]3 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 a monarchist?​
Alik [6]

Answer:

a supporter of the principle of having monarchs

4 0
3 years ago
Read 2 more answers
What are the characteristics of a Mediterranean climate and where is this type of climate found in the Middle
Lady bird [3.3K]

Answer:Mediterranean climates are found along the Mediterranean coast on the Anatolian Peninsula. This climate has hot, dry summers and cool, rainy winters. Shrubland or chaparral ecosystems are common, and there are some forests as well. Areas with Mediterranean climates contain wide varieties of wildlife, including brown bears, eagles, foxes, and deer. Olive and cedar trees are common to the areas, and there are some deciduous trees.

Explanation:

5 0
4 years ago
According to George Washington, how is the Whiskey Tax different than the taxation by the British?
qaws [65]

Answer: The nation has a system of government now

8 0
3 years ago
Read 2 more answers
(25+ POINTS &amp; BRAINLEST!) EASY! All of these presidents have one thing in common – except one. Who is the odd one out?
mamaluj [8]

Answer:

your answer is b.john f kennedy

6 0
3 years ago
According to this document what are two ways that steam engines helped the economy in great britain.
Drupady [299]

Answer:

One steam engine could power many spindles and looms. This meant that people had to leave their homes and work together in factories. Early in the 19th century the British also invented steam locomotives and steamships, which revolutionized travel.

Explanation:

8 0
2 years ago
Other questions:
  • 3. What information were the scientists able to learn from the skeleton itself?
    7·1 answer
  • What represents letter E on the map?
    10·1 answer
  • Why did Jackson's supporters think he made a good presidential candidate? Check all of the boxes that apply.
    7·2 answers
  • Ito at may masistemang balance na naka ayos​
    8·1 answer
  • What actions made it most difficult to slow down the progression to all-out war in Europe in 1914?
    7·1 answer
  • Look at the map.
    12·1 answer
  • why would it be important for the government to regulate areas such as medicine and neighborhood conditions?​
    5·1 answer
  • HELP was soon as possible please, ill give you brainliest and answer some of your questions if i know them!!!
    7·2 answers
  • What does the phrase the spirit of the Renaissance mean, and why is this a good title for this chapter?
    13·1 answer
  • What was the purpose behind creating the powerful un security council
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!