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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started