Advertisement
FelipeNeto2

Contador de dígitos

Jul 25th, 2020
1,467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def quant(n):
  2.   cont = 0
  3.   control = False  
  4.  
  5.   p = n//10
  6.   while control == False:
  7.     cont += 1
  8.     p = n//10
  9.    
  10.     if p<10:
  11.       control = True
  12.  
  13.   return cont
  14.  
  15. n = int(input("Digite: "))
  16.  
  17. #quant(n)
  18. print("{}".format(quant(n)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement