Question: Write a program to show users a set of choices, and then respond to those choices until they choose to quit (q). For each option,

Write a program to show users a set of choices, and then respond to those choices until they choose to quit (q).

For each option, write a function. Each function should do as follows:

halfstring() Ask the user to enter the string of even length. Your function should display the last half string. For example, HelloWorld should display World.

first_three_char() As the k user to enter the string. Your function should display the string made up of the first three characters. For example, HelloWorld will display Hel.

If the string is shorter than length 3, display whatever there is, so "He" yields "He", and the string is empty, then display Empty String.

When a user enters q, it should display See you later. See the sample output.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!