I have the following list
x = ['Accara building model (ABM)','tri-com model (tcm)']
Using re I was able to ignore the words in the parentheses. Like below
import re
x = ['Accara building model (ABM)','tri-com model (tcm)']
for i in x:
ko= list(re.sub("[\(\[].*?[\)\]]", "", i))
print (ko)
but I get the output in the below format
['A', 'c', 'c', 'a', 'r', 'a', ' ', 'b', 'u', 'i', 'l', 'd', 'i', 'n', 'g', ' ', 'm', 'o', 'd', 'e', 'l', ' ']
['t', 'r', 'i', '-', 'c', 'o', 'm', ' ', 'm', 'o', 'd', 'e', 'l', ' ']
What I ideally want is like below in the fewest possible lines of code. (I know my code is currently inefficient)
Ideal output required
['Accara building model', 'tri-com model']