Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions