• + 2 comments

    For checking the visualisation of your code... TRY...

    pythontutor.com

    You can check the test cases and exact bug in your code. :-)