Why my function not returning the value i want | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Why my function not returning the value i want

Here I have made a factorial function and made a return statement for fac inside if statement but is not returning but code is running inside the if statement because when i use a print statement inside if statement it is working. https://code.sololearn.com/cUbfHraYV4QP/?ref=app

14th Nov 2022, 6:16 AM
Akash
Akash - avatar
1 Antwort
+ 1
You have to return the value of all call of factorial (see "else" block)
14th Nov 2022, 7:08 AM
KrOW
KrOW - avatar