def digit_sum(n):

if n < 100:

ones = n % 10

tens = n // 10

print ones + tens

elif n > 99 and n < 1000:

ones = n % 10

tens = n % 100 // 10

hundreds = n // 100

print ones + tens + hundreds

digit_sum(434)

I got it to return 11 but says Oops, try again. Your function fails on digit_sum(434). It returns None when it should return 11.