I want to create a list given a string such as 'b123+xyz=1+z1$'
so that the list equals ['b123', '+', 'xyz', '=', '1', '+', 'z1', '$']
Without spaces or a single repeating pattern, I do not know how to split the string into a list.
I tried creating if statements in a for loop to append the string when it reaches a character that is not a digit or letter through isdigit
and isalpha
but could not differentiate between variables and digits.