+ 3
How to define a function that...?
Hey friends ! i want to make this function which takes a string as input & if there's parenthesis in the string ,it deletes them with their content. Just like this : input=This is a (sample) text with an expression (in parenthesis). output=This is a text with an expression. . . . Will anyone help me, plz? Already thx -_*
4 ответов
+ 7
Crude, but works ;)
https://code.sololearn.com/clZfuPm9N4Xv/?ref=app
+ 6
You can use the re module for that. Manipulating regex is tricky but gets the job done quite nicely:
https://code.sololearn.com/cqV91JVdKQ5H/?ref=app
+ 2
Thx a lot. what if we didn't use module ?