Created
March 10, 2022 21:27
-
-
Save NguyenDa18/959dfa0034c7394681408718ec3373aa to your computer and use it in GitHub Desktop.
Remove parentheses with Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parens_table = str.maketrans(dict.fromkeys("()")) | |
# remove parens | |
converted = converted.translate(parens_table) | |
return converted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment