Can you help with this code


I cant seem to find why isnt my code producing the right ans

Hello @anushreemahur5,

I have corrected your code:


Refer to comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.