>>> x='test' >>> x==x.isdigit() False >>> x==x.isalpha() False >>> x.isalpha() True >>> y='123' >>> y.isdigit() True