The 2D Poisson equation is solved in an iterative manner (number of iterations is to be specified) on a square 2x2 domain using the standard 5-point stencil. Homogenous neumann boundary conditions have been used.
There is a typo in your code. The source term in the iterative formula is multiplied by dy*2 instead of dy^2.
Otherwise your code is a big helpful.
The code is meant to be pedagogical in nature and has been made in line with the 12-steps to Navier-Stokes practical module, for which I would like to credit Lorena Barba and her online course on CFD.
Create scripts with code, output, and formatted text in a single executable document.