0 out of 464 challenges solved
Write a function `remove_parentheses` that takes a string as input and removes all parentheses and the text inside them. The function should return the modified string.
#### Example Usage
```python [main.nopy]
remove_parentheses("python (chrome)") # Output: "python"
remove_parentheses("string(.abc)") # Output: "string"
remove_parentheses("alpha(num)") # Output: "alpha"
```
#### Constraints
- The input string may contain multiple sets of parentheses.
- Ensure that no extra spaces are left behind after removing the parentheses and their contents.import re
def remove_parentheses(text):
"""
Remove all parentheses and their contents from the given string.
Args:
text (str): The input string.
Returns:
str: The string with parentheses and their contents removed.
"""
# Replace this comment with your implementation
pass