How to know if the characters of a string are digits in python?