0
Sum of digits, pls help
How can I find (and print) all numbers less than n whose sum of digits equals 10? User inputs n and n must be bigger than 100. Thank you
5 Réponses
+ 1
Isn't that just multiples of 10 though?
I've done this...
https://code.sololearn.com/cUVSQe90ktAb/?ref=app
0
n=input("enter a number")
tot=0
if n>100:
while(n>0):
dig=n%10
tot=tot+dig
n=n//10
if tot==10:
print tot
else:
print "not equal to ten"
else:
print "enter number greater then 100"
if still problem persist you can mail me
0
Yes Max, but I must do it without converting to string
Thank you both
0
Why?
0
My professor said that 😏