python isdigit negative

Solutions on MaxInterview for python isdigit negative by the best coders in the world

showing results for - "python isdigit negative"
Lautaro
05 Mar 2020
1>>>'-6'.lstrip('-')
2'6'
3>>>'-6'.lstrip('-').isdigit()
4True
Serena
02 Oct 2019
1def is_digit(n):
2    try:
3        int(n)
4        return True
5    except ValueError:
6        return  False
7
8if is_digit(question):
9   ....
10
similar questions
queries leading to this page
python isdigit negative