I have a phone number(string), e.g. \"+123-456-7890\", that I want to turn into a list that looks like: [+, 1, 2, 3, -, ...., 0].
Why? So I can go iterate through t
Instead of converting to a list, you could just iterate over the first string and create a second string by adding each of the digit characters you find to that new string.
Make a list(your_string).
>>> s = "mep"
>>> list(s)
['m', 'e', 'p']
A python string is a list of characters. You can iterate over it right now!
justdigits = ""
for char in string:
if char.isdigit():
justdigits += str(char)