Remove string with brackets in List (Python)

I have a list

thislist = ["apple (red)", "banana (yellow)", "cherry (red)"]

How do I remove/strip off the brackets in each item of the list?

Desire Output:

thislist = ["apple red", "banana yellow", "cherry red"]

Thank you



Read more here: https://stackoverflow.com/questions/67385343/remove-string-with-brackets-in-list-python

Content Attribution

This content was originally published by bobthebilly at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: