Reduce the last digit from the number using floor division ( number = number // 10)
Increment counter by 1
print counter
Solution:
num = 75869
count = 0
while num != 0:
# floor division
# to reduce the last digit from number
num = num // 10
# increment counter by 1
count = count + 1
print("Total digits are:", count)
Hint:
counter = 0
number != 0
number = number // 10
)Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer