Strange output in recurtion. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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