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
Why is Abraham such an important figure in early Jewish history?
Natalija [7]

C. Abraham founded the Jewish religion and led the Israelites to

Canaan.

Explanation:

  • Abraham, the leader, led the tribes and they came to the promised land of Canaan.
  • Abraham felt that there would be fewer people and that it would be easier to handle livestock. However, there is very little arable land.
  • They cross the Red Sea and come to Egypt, which was already a regulated state.
  • They were enslaved there, enslaved for 500 years. Moses saves them from slavery, who transports them across the Red Sea and leads them to Jerusalem.

Learn more on Canaan on

brainly.com/question/346803

brainly.com/question/1150339

brainly.com/question/409163

#learnwithBrainly

5 0
3 years ago
What would have happened if north korea won the korean war?
nasty-shy [4]
All of Korea would have been communist and much of what you see today with North Korea would probably have been the state of all Korea had the North won.

It also would have spread communism to a much farther degree and the U.S. would not have South Korea as an ally.
5 0
3 years ago
What year was the constitution written
Ksivusya [100]

Answer:

1787

Explanation:

James Madison wrote the constitution at 1787

7 0
3 years ago
Read 2 more answers
One of the keys goals of the 1913 federal reserve act
vichka [17]
Was to bring economic stability by allowing printed money. 

Hope this helps! Have a great day :)
7 0
3 years ago
PLEASE HELP ILL MAKR YOU BRAINLYEST IF YOURE THE FIRST ONE TO ANSWER RIGTH!
Vedmedyk [2.9K]

Answer:

Voting C

Explanation:

7 0
3 years ago
Other questions:
  • What is Poseidon the god of?
    8·2 answers
  • What caused the Revolutions of 1848 in Europe? Check all that apply.
    7·2 answers
  • • Types of laws that the government might pass, including steps factory owners should take to improve conditions or steps that t
    15·1 answer
  • All Dakota took part in the fighting. Question 2 options: True False
    6·1 answer
  • General Ibrahim Babangida, in Nigeria, was most interested in reforming
    12·1 answer
  • How did scientific rationalism affect governments?
    13·2 answers
  • How does the Money Cycle with Banks help the economy?
    5·1 answer
  • Help help
    10·1 answer
  • What happens when cultures collide? Good and bad please.
    9·2 answers
  • Why did the delegates at the Stamp Act Congress believe Britain did not have the right to tax the colonies?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!