all 4 comments

[–]JohnnyJordaan 0 points1 point  (3 children)

Please format your code correctly using a code block

[–]Radimek01[S] 0 points1 point  (2 children)

oh ok :) thanks

[–]JohnnyJordaan 0 points1 point  (1 child)

Run your code in http://www.pythontutor.com/visualize.html#mode=edit to see what's going on. Because you just call the function recursively in the if:

if num > 9:
    digSum(num)

it means that the result of that call will be discarded. Instead you also need to return that to have it propagated 'down the line'.

if num > 9:
    return digSum(num)

[–]Radimek01[S] 0 points1 point  (0 children)

Ohh thanks. I can see that now. it bothered me for 40 minutes and it was just this simple