(n)
| 46 | # 4..TO FIND THE SUM OF ALL DIGITS IN THE GIVEN NUMBER |
| 47 | |
| 48 | def sum(n): |
| 49 | assert n>=0 and int(n)==n , "only positive integers" |
| 50 | if n==0: |
| 51 | return 0 |
| 52 | else: |
| 53 | return int(n%10) + sum(int(n//10)) |
| 54 | |
| 55 | print(sum(11)) |
| 56 |
no outgoing calls
no test coverage detected