the assert statement on line ensures that the board width and height we've selected will result in an even number of boxes (since we will have pairs of icons in this gamethere are three parts to an assert statementthe assert keywordan expression whichif falseresults in crashing the program the third part (after the comma after the expressionis string that appears if the program crashes because of the assertion the assert statement with an expression basically says--the programmer asserts that this expression must be trueotherwise crash the program |this is good way of adding sanity check to your program to make sure that if the execution ever passes an assertion we can at least know that that code is working as expected telling if number is even or odd if the product of the board width and height is divided by two and has remainder of (the modulus operator evaluates what the remainder isthen the number is even even numbers divided by two will always have remainder of zero odd numbers divided by two will always have remainder of one this is good trick to remember if you need your code to tell if number is even or oddiseven somenumber = isodd somenumber ! in the above caseif the integer in somenumber was eventhen iseven will be true if it was oddthen isodd will be true crash early and crash oftenhaving your program crash is bad thing it happens when your program has some mistake in the code and cannot continue but there are some cases where crashing program early can avoid worse bugs later if the values we chose for boardwidth and boardheight that we chose on line and result in board with an odd number of boxes (such as if the width were and the height were )then there would always be one left over icon that would not have pair to be matched with this would cause bug later on in the programand it could take lot of debugging work to figure out that the real source of the bug is at the very beginning of the program in factjust for funtry commenting out the assertion so it doesn' runand then setting the boardwidth and boardheight constants both to odd numbers when you run the programit will immediately show an error happening on line in memorypuzzle pywhich is in getrandomizedboard(functiontraceback (most recent call last)email questions to the authoral@inventwithpython com