+ 1

Strange output in recurtion.

Why does it print "None" instead of 6? https://code.sololearn.com/cUUHbt9FIES1/?ref=app

27th Oct 2021, 11:15 AM
Carlos
Carlos - avatar
2 ответов
+ 5
because you print a print statement Your last line calls to print, but so does inside the function you call
27th Oct 2021, 11:51 AM
Slick
Slick - avatar
+ 4
at the end of function you return nothing return digital_root(sum([int(i) for i in str(n)]))
27th Oct 2021, 12:02 PM
zemiak