how to handle negatives when using isdigit in python code example Example: a.isdigit(): for negatives >>>'-6'.lstrip('-') '6' >>>'-6'.lstrip('-').isdigit() True