list non alphanumeric characters in python code example
Example 1: python string strip non alphanumeric
Regular expressions to the rescue:
import re
stripped_string = re.sub(r'\W+', '', your_string)
Example 2: remove alphabetic characters python
numeric_answer = filter(str.isdigit, original_string)
numeric_answer = "".join(numeric_answer)