I have this code that prints the digits of a positive number but when I add a negative number it comes out error is not a number,
dato_entrada=input("INTRODUZCA UN NÚMERO: ")
if dato_entrada.isdigit():
dato_entrada=int(dato_entrada)
if dato_entrada < 0:
dato_entrada= (dato_entrada * -1)
cont = 0
cont += 1
else:
aux_number = dato_entrada
cont=0
while aux_number != 0:
aux_number= dato_entrada // 10
dato_entrada=dato_entrada // 10
cont += 1
print(f"El número tiene {cont} dígitos" )
else:
print("El dato introducido no es un numero")
I need to read any number, I need help?