Question: python program with nested loop and without using enumerate function .Practice 2-D list, nested loop, file input, and modular design with functions. A Lo Shu

 python program with nested loop and without using enumerate function .Practice

2-D list, nested loop, file input, and modular design with functions. A

python program with nested loop and without using enumerate function

.Practice 2-D list, nested loop, file input, and modular design with functions. A Lo Shu Magic Square is a grid with N rows and N columns that satisfies the following properties: The grid contains the numbers 1 through N2 exactly. In other words, each cell in the grid contains an integer between 1 and N2, and no two cells share the same integer The sum of each row, each column, and each diagonal all add up to the same number. . * An example of 3 x 3 Lo Shu magic square is shown below 3 5 7 The sum of each row, each column, and each diagonal for the above example all add up to 15. You are asked to write a Python program to read a grid that is stored in a file, and determine whether that grid is a Lo Shu Magic Square. The input file contains exactly N lines, one for each row in the grid. Each line contains exactly N numbers. Each number is separated by a comma. No space is allowed before or after comma. For the above example grid, the corresponding input file should be of the following format: 4,9,2 3, 5,7 8,1,6 Please do unit testing with different text file formats on both Apple and Windows platforms to make e their incompatibilities, if any. Your program prompts users for a file name, reads in all N2 integers stored in the file, determines whether the represented gri d is a Lo Shu Magic Square, and displays the result on the screen Hint: You can represent a gird with a two-dimensional list. User interface specifications: . Input The program prompts from users for the needed file name

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!