rows [for in range(numrow)cols [for in range(numcol)ent entry(relief=ridgeent grid(row=icolumn=jsticky=nsewent insert(end'% % (ij)cols append(entrows append(colssums [for in range(numcol)lab label(text='?'relief=sunkenlab grid(row=numrowcolumn=isticky=nsewsums append(labdef onprint()for row in rowsfor col in rowprint(col get()end='print(print(def onsum()tots [ numcol for in range(numcol)for in range(numrow)tots[ +eval(rows[ ][iget()for in range(numcol)sums[iconfig(text=str(tots[ ])sum column display in gui def onclear()for row in rowsfor col in rowcol delete(' 'endcol insert(end' 'for sum in sumssum config(text='?'import sys button(text='sum'command=onsumgrid(row=numrow+ column= button(text='print'command=onprintgrid(row=numrow+ column= tkinter tourpart