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
Х
Harman [31]

Answer:

D

Explanation:

It's just d I don't have anything else to say

7 0
2 years ago
The Aryans... Select one: a. dominated ancient India after their arrival from the north. b. assimilated with the Dravidians to f
nikitadnepr [17]

Answer:

d

Explanation:

4 0
3 years ago
What appears to be the characteristics of the Carolingian Empire?
Alenkinab [10]

Answer:

During the Carolingian Renaissance, as it is called by modern scholars, Frankish rulers supported monastic studies and manuscript production, attempted to standardize monastic practice and rules of life, insisted on high moral and educational standards for clergy, adopted and disseminated standard versions of canon law ...

Explanation:

6 0
3 years ago
Break out Rooms:List of the strengths and weaknesses of the Articles of Confederation.
Dmitry [639]

Answer:

strengths: could pass laws that affected all states, had the power to manage Native Americans affairs, Congress had the power to deal with foreign affairs, declare war, and sign treaties

Weakness: no national Court, no president or executive branch, no army or navy, no national money, national government could not tax, Congress had no power to regulate trades between the states, each state could tax trade between states, could not force stay to obey the laws

8 0
3 years ago
Read 2 more answers
PLEASE HELP !!
CaHeK987 [17]

Answer:

O Each branch of government can check the power of the other two.

Explanation:

Separation of powers

7 0
2 years ago
Other questions:
  • What were the political consequences of the revolution religion during the mid 1700s
    9·1 answer
  • Which of the following actions is an example of the Renaissance idea of
    10·2 answers
  • How European powers responded to Islamic expansion
    5·1 answer
  • A person who favored independence from great britain would be described as a
    11·1 answer
  • How did Thomas Jefferson fare in keeping true to his beliefs when they came into conflict with political realities as president?
    8·1 answer
  • Why were the Twelve Tables written? Choose four correct answers.
    11·2 answers
  • Did Columbus leave home? If did why?
    7·2 answers
  • Why did Spain return its trans-Mississippi territory to France in 1800
    13·1 answer
  • Adelle and Alicia are best friends and live in a small town in Texas Alicia loves to go to Adelle's for dinner
    15·1 answer
  • 1. Kailan pumirma ang Pilipinas sa CEDAW?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!