write a program to print the number of digits ty taking number from users?
Answers
Answered by
0
Answer:
This was the answer given by me. Hope that it was helpful for you
Attachments:
Answered by
0
Following are the program in python for the above question :
Explanation:
number=input("Enter the number: ")#take the input from the user.
count=0 #intialize the count by 1.
for x in number:#for loop which reads the number 1 by 1.
count=count+1 #count the value.
print("The total number of digit on the "+number+" is: "+str(count))# print statement which prints the value.
Output:
- If the user inputs as "66666", then it will prints 5.
- If the user inputs as"3", then it will prints 1.
Code Explanation:
- The above code is in python language, which takes the value from the user as a string.
- Then the for loop scans all the character and count will increase by 1.
- Hence if the user inputs any number, then it will be counted and print the result.
Learn More:
- Python :brainly.in/question/14689905
Similar questions
English,
4 months ago
Math,
4 months ago
Math,
8 months ago
Computer Science,
8 months ago
Hindi,
10 months ago