python isdecimal does not work with negative code example Example: a.isdigit(): for negatives Click to copy>>>'-6'.lstrip('-') '6' >>>'-6'.lstrip('-').isdigit() True