• what is wrong in my solution?

Question related to mission Number Length

 

I tried the code in other IDE (without function), the body seems to work properly. What causes an error here? I am using for loop to cut the last digit each time it's looping through, and outputting the number of loops (counter) it went through.

def number_length(a: int) -> int:

counter = 0
for i in range(a):
    a // 10
    counter += 1

return counter