>>>'-6'.lstrip('-') '6' >>>'-6'.lstrip('-').isdigit() True
def is_digit(n): try: int(n) return True except ValueError: return False if is_digit(question): ....