Why is am getting error in this code


I have solved it with another approach but I want to debug this code which is not working

Hello @Jainish-Patel-1007094602980100,

I have corrected your code:

Refer to comments for better understanding.