#Count no. of #digits in an #integer using #multiple #ways #Python

preview_player
Показать описание
Music Credits
Music Cuba
Musician ASHUTOSH

Link to Python Basics:
👇👇👇

Link to Computer System and Python Fundamentals:
👇👇👇

Link to Python Codes:
👇👇👇

Link to Math Functions:
👇👇👇

Link to String Functions:
👇👇👇

Link to List and Dictionary Functions:
👇👇👇

Link to Patterns:
👇👇👇

Link to Python Library Programs:
👇👇👇
Рекомендации по теме
Комментарии
Автор

#Source_code:
#PYTHON PROGRAM TO COUNT THE NO OF DIGITS IN AN INTEGER

n=int(input('Integer: '))

#method1: using string function

print('Length of integer: ')
print(len(str(n)))


#method2: using while loop

count=0

while n!=0:
n=n//10
count+=1

print('No. of digits: ')
print(count)

snehaiitian
join shbcf.ru