My code is getting stuck in one case. Please help me in rectifying my code. Kindly suggest the logic which I should implement and add or change in my code

Here is my code. Please help me in rectifying it.

Hi @sinchan1509_1a917d7b6cc3cbb9
You didn’t add a condition when n = 0, it should print 5 but your code is giving the wrong output 0.

ok thak you so much. I passes all the condition cases.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.