fork(2) download
  1. def somadig(n):
  2. if n == 0:
  3. return 0
  4. else:
  5. return (n % 10) + somadig(n // 10)
  6.  
  7. print(somadig(120))
  8.  
  9. #https://pt.stackoverflow.com/q/349093/101
Success #stdin #stdout 0.02s 27640KB
stdin
Standard input is empty
stdout
3