how to delete both parenthases in python code example
Example 1: how to remove text in brackets of python
>>> import re
>>> x = "This is a sentence. (once a day) [twice a day]"
>>> re.sub("[\(\[].*?[\)\]]", "", x)
'This is a sentence. '
Example 2: remove all parentheses from string python
>>> table = str.maketrans({"(":None, ")":None})