I have the mathematical expression in string format. Which contains only '+' or '-' operators. I have to split the string on the basis of operators.
expr = '1234 + 896 - 1207 + 1567 - 345' words = word.split('-\|+') print(words)
I have tried this but it gives original string as it is.
Austin answered question
Have an answer?