两种办法:
1、
def getLength(number):
# 判断位数
Length = 0
while number != 0:
Length += 1
number = number // 10
return Length
2、
def getLength(number):
num= len(str(number))
return num
两种办法:
1、
def getLength(number):
# 判断位数
Length = 0
while number != 0:
Length += 1
number = number // 10
return Length
2、
def getLength(number):
num= len(str(number))
return num