miscellaneous topics ii example common math problem is to find the solutions to system of equations sometimes you want to find only the integer solutionsand this can be little tricky mathematically howeverwe can write program that does brute force search for solutions here we find all the integer solutions (xyto the system where and are both between - and for in range(- , )for in range(- , )if * + * == and - == print( ,yexample pythagorean triple is triple of numbers (xyzsuch that for instance ( is pythagorean triple because pythagorean triples correspond to triangles whose sides are all whole numbers (like -trianglehere is program that finds all the pythagorean triples (xyzwhere and are positive and less than for in range( , )for in range( , )for in range( , )if ** + ** == ** print( , ,zif you run the programyou'll notice that there are redundant solutions for instance( and ( are both listed to get rid of these redundancieschange the second loop so that it runs from to this waywhen is for instancethe first value for that will be searched is rather than and so we won' get the redundant ( also change the third loop so that it runs from to as you look through the solutionsyou might also notice that there are many solutions that are multiples of otherslike ( )and ( are multiples of ( the following program finds only primitive pythagorean triplesthose that aren' multiples of another triple the way it does this is every time new triple is foundit checks to make sure that xyand are not all divisible by the same number for in range( , )for in range( , )for in range( , )if ** + ** == ** for in range( , )if % == and % == and % == break elseprint(( , , )end'example in section we will write game to play tic-tac-toe the board is gridand we will use nested for loops to create it