Below is the link of code I am stuck at:
I am getting the below error:
File “python”, line 13
IndentationError: unexpected indent
I was expecting it to run successfully. I have tried so many times but the code is keeping on throwing indentation errors.
Below is the code I have written: def digit_sum(n): sum_digits = 0 if n < 0: print "This is a negative no." return elif n == 0: return 0 else: while n > 0: rem = n % 10 sum_digits += rem n /= 10 return sum_digits
Someone please suggest what can be the mistake that is throwing the “Indentation error” here?