Assignment
University
CollegeCourse
College Computer SciencePages
1
Academic year
2023
Avaiya Priyank
Views
0
p {margin: 0; padding: 0;} .ft00{font-size:23px;font-family:Calibri-Light;color:#ff0000;} .ft01{font-size:16px;font-family:Calibri;color:#000000;} .ft02{font-size:23px;line-height:31px;font-family:Calibri-Light;color:#ff0000;} Q4. Given a number count the total number of digits in a number For example, the number is 75869, so the output should be 5. x=int(input("Enter the number: ")) c=0 while x!=0: x=x//10 c = c + 1 print("Number of digit in given number is ",c);
Counting Digits in a Number using Python
Please or to post comments