Python Loop Through Two Dimensional Figures