how to check for a number in a string python code example Example: test if character is number python string >>> 'A'.isdigit() False >>> '1'.isdigit() True