Can you tell me the error in this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you tell me the error in this code

factorial by recursion https://code.sololearn.com/c1x27L2XwPtT/?ref=app

8th Jul 2018, 8:26 AM
Meera Vinod
Meera Vinod - avatar
3 Answers
+ 3
if n = 1 you need to return 1 instead of the print statement. in the else statement the indentation is wrong (1 space to much).
8th Jul 2018, 8:43 AM
davy hermans
davy hermans - avatar
+ 2
It's recognizing * as a symbol. You might have to make your own multiple function or use one from a library
8th Jul 2018, 8:48 AM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar
0
thanks!
8th Jul 2018, 8:52 AM
Meera Vinod
Meera Vinod - avatar