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
To discourage African Americans, white Southerners used voter ... (blank)
Daniel [21]

Answer:

Intimidation

Explanation:

Southerners uses intimidation tactics like lynching to frighten black voters away from voting stations.

3 0
4 years ago
Read 2 more answers
Which group received suffrage rights FIRST?
Eva8 [605]
D I think I am prolly wrong tho
3 0
3 years ago
Read 2 more answers
How did Robert de La Salle help extend France’s influence in the New World?
IgorC [24]
<span>He explored the Mississippi River and built trading posts on it</span>
7 0
4 years ago
If a man traveled in a direct path from Georgia to California which ecosysetem would he NOT pass through?
worty [1.4K]

Answer:

D. Tundra

Explanation:

because I had fallen ill

6 0
3 years ago
Read 2 more answers
What are the similarities of peter the great and emperor meiji?
jekas [21]
The main similarities of peter the great and emperor meiji were that they both went to great lengths to implement reforms that helped "modernize" their respective countries. 
4 0
3 years ago
Other questions:
  • Who is your heir? Explain your answer
    15·1 answer
  • Read the paragraph.
    12·2 answers
  • How has the geography,economy, culture, government, and history of China affected the population and migration of the people of
    13·1 answer
  • The absolute monarchs of medieval Europe used all of the following methods to preserve their power except:
    7·2 answers
  • Kate has read reports of a nearby rebellion that occurred where more than 60 white people were killed by escaped enslaved people
    13·1 answer
  • What was the abolitionist movement?
    12·2 answers
  • How did Woodrow Wilson’s foreign policy differ from that of Theodore Roosevelt’s and William Howard tafts
    6·1 answer
  • Write a letter to your french cousin who thinks the US is obnoxious and pushy and imperialistic explaining why the US took over
    8·1 answer
  • Which artist recorded and popularized the 1950s hit rock around the clock?
    5·1 answer
  • In which region, Europe or Japan, did farmers enjoy a higher social status and why? In Europe because Christianity taught the fi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!