Python - WAP to Count the Digits in a Number in Python - 11
Source Code:
#!/usr/bin/python3 while True: num = int(input("Enter a Number : ")) count = 0 # Counting the Total Digits while (num > 0 ): count += 1 num = num // 10 # Printing the digits. print ("The Number of Digits is :", count) # Continue block. print (" - Codegig.org") if (input("To Continue ['y'] : ") == 'y' ): continue else: break
Program Output:
....
Post a Comment