Python programming problem "loop loop" [on hold]

enter the description of the image here

Can any one help. I need to add a while loop if the input of n <= 0 and m <= 0