Ответсообщение недоступно
def remove_parentheses(string: str):
converted_string = list(string)
if '(' in converted_string:
left = converted_string.index('(')
if ')' in converted_string:
right = converted_string.index(')')
del converted_string[left: right+1]
string = ''.join(converted_string)
return string
print(remove_parentheses('example(unwanted thing)example'))