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
Get step-by-step solutions from verified subject matter experts
