Question: why is 0 greater than 0 in this python code and the while loop doesn't end when the number gets divided to 0? 1 count

why is 0 greater than 0 in this python code and the while loop doesn't end when the number gets divided to 0?

1 count = 0

2 number = int(input("Enter a number "))

3 while (number > 0):

4 number = number/10

5 count = count + 1

6 print ("Total number of digits : ",count)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!