Hello! I need to do two functions: one returning the number of digits of a non-negative integer and the other reversing the number

Asked

Viewed 18 times

-1

Finally, I need to print out a tuple. I’m having difficulty with for example the input 30000 return (5, 00003) when it should return (5,3) and the input 103090 returning (6, 090301) when it should be (6, 90301).


def digitos(numero):
    return len(numero)
    
def inverso(numero):
    return (numero)[::-1]

print(digitos(numero),inverso(numero))
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.