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
An entrepreneur is a person who works for themselves. They own their own business. What are some of the challenges of being an e
grandymaker [24]

Answer:

c or b cut off the rest they dont maje any sense

6 0
3 years ago
Read 2 more answers
The act that forbade the issue of presidential orders to the army without going through the General of the Army was the:
Yuliya22 [10]
The best and most correct answer among the choices provided by the question is the second choice. <span>The act that forbade the issue of presidential orders to the army without going through the General of the Army was the was the Fifteenth Amendment. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Read 2 more answers
Small farms and ranches mark the ____ region of Mexico, where revolutionary leaders like Pancho Villa, Venustiano Carranza and P
vesna_86 [32]

<span>The right answer is C. northern   your welcome</span>

<span />

3 0
3 years ago
Read 2 more answers
ANSWER FOR 20 POINTS!!
Vsevolod [243]

Answer:

As a result of Johnson’s leniency, many southern states in 1865 and 1866 successfully enacted a series of laws known as the “black codes,” which were designed to restrict freed blacks ...

Explanation:

ur welcome

3 0
3 years ago
Read 2 more answers
Federation of America Indians were groups of
Scrat [10]

Answer:

Federations of American Indians were groups of RIGHT tribes.

8 0
3 years ago
Other questions:
  • Which of the following are factored into the impact of consumption of items?
    14·1 answer
  • What is the economic significance of the Dow Jones industrial Average?
    12·1 answer
  • Why were immigrants turned into suspects in WW1?
    13·2 answers
  • Read the quote by the Baron de Montesquieu from The Spirit of the Laws.
    10·2 answers
  • The Byzantine church of San Vitale is known for its beautiful mosaics. In which country is it situated?
    6·2 answers
  • Historia de la psicológica clinica
    15·2 answers
  • In what zone was the city of Berlin located?<br> Soviet Union <br> USA<br> British
    7·2 answers
  • What did the 1852 constitution change regarding<br> representation in the Louisiana legislature?
    6·1 answer
  • Choose the word or phrase that best completes each sentence.
    10·1 answer
  • What kind of life did free african americans have
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!