Question: Write a python program that prompts the user to enter a sentence in which there can be text in brackets (text). The program must identify

Write a python program that prompts the user to enter a sentence in which there can be text in brackets "(text)". The program must identify where the text in brackets is, remove the text and the brackets from the sentence, and then print it. The beginning of the text to be removed follows the first instance of the "(" character in the sentence. The last instance of the ")" character in the sentence marks the end of the text to be removed. The program must remove the text, the brackets around it and the space on the left side of the left bracket. A sentence without a "(" character and ")" character does not have any text to be removed. Some examples of the program being run are shown below. Note: The text to remove may include "(" and ")" characters. The output must be in the format shown in the examples below, including the format of the prompt and all spaces and punctuation. Your answer must not use a while loop.

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!