Jul-07-2020, 09:05 AM
(This post was last modified: Jul-07-2020, 09:05 AM by samuelbachorik.)
Hello dear users, iam using import re function to split my strings. For example i want to split characters +,- and string is "50+50-50" i get output ['50', '50', '50']. Is it possible to know if "-" or "+" was splitted and where ? Or is it possible to get output also with theese splitted characters ? So something like ['50','+','50', '-', '50']
here is code
here is code
import re calc = "50+50-50" answer = re.split('\*|\-|\+|\/',calc) print(answer)
My github:
https://github.com/Samuel-Bachorik
https://github.com/Samuel-Bachorik