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
Created at: 2021/10/15 10:01; Updated at: 2021/10/18 09:59