Digit sum


#1

https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/4?curriculum_id=4f89dab3d788890003000096#

I am getting the correct output but still i am getting the error like below
Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.

Is it a bug.Can someone help me out?

. 
def digit_sum(n):
    n=str(n)
    sum=0
    for i in range(0,len(n)):
        
        sum += int(n[i])
    print sum  
digit_sum(434)

o/p:11


#2

your function prints the digit sum, it doesn't return the digt sum


#3

Thanks for that!
Now the code works!!


#4