Question: using pyhon 3 The printSquare Function This function takes a two-dimensional list as a parameter. It assumes the list is a magic square. The function

using pyhon 3

The printSquare Function

This function takes a two-dimensional list as a parameter. It assumes the list is a magic square. The function prints the magic square using uniform column widths. The width of each column should be based on the maximum number of digits of all the numbers in the square. The function header should be:

def printSquare(sq):

Below are two two sample outputs from the printSquare function. Notice how the numbers in the second square are printed using a wider column width.

 8 1 6 17 24 1 8 15 3 5 7 23 5 7 14 16 4 9 2 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9 

This function (and any additional functions you may need) should be saved in a file called printSquare.py.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!