If I want to find the sum of the digits of a number, i.e.:
932
14
(9 + 3 + 2)
you can also try this with built_in_function called divmod() ;
number = int(input('enter any integer: = ')) sum = 0 while number!=0: take = divmod(number, 10) dig = take[1] sum += dig number = take[0] print(sum)
you can take any number of digit