“Python Isdigit negativo” Respostas de código

a.Isdigit (): para negativos

>>>'-6'.lstrip('-')
'6'
>>>'-6'.lstrip('-').isdigit()
True
Jittery Jay

Python Isdigit negativo

def is_digit(n):
    try:
        int(n)
        return True
    except ValueError:
        return  False

if is_digit(question):
   ....
Coding Cat

Respostas semelhantes a “Python Isdigit negativo”

Perguntas semelhantes a “Python Isdigit negativo”

Mais respostas relacionadas para “Python Isdigit negativo” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código