In a python program you can simulate a magic square using a two-dimensional list. Write a function that accepts a two-dimensional list as an argument and determines whether the list is a Lo Shu Magic Square. Test the function in a program.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 3GZ
icon
Related questions
Question

In a python program you can simulate a magic square using a two-dimensional list. Write a function that accepts a two-dimensional list as an argument and determines whether the list is a Lo Shu Magic Square. Test the function in a program.

Figure 7-19 The sum of the rows,
columns, and diagonals
15
4
9
2 +15
3
5
7
15
8
1
6
15
15
15
15
15
In a program you can simulate a magic square using a two-dimensional list. Write a function
that accepts a two-dimensional list as an argument and determines whether the list is a Lo Shu
Magic Square. Test the function in a program.
Transcribed Image Text:Figure 7-19 The sum of the rows, columns, and diagonals 15 4 9 2 +15 3 5 7 15 8 1 6 15 15 15 15 15 In a program you can simulate a magic square using a two-dimensional list. Write a function that accepts a two-dimensional list as an argument and determines whether the list is a Lo Shu Magic Square. Test the function in a program.
11. Lo Shu Magic Square
The Lo Shu Magic Square is a grid with 3 rows and 3 columns, shown in Figure 7-18. The Lo
Shu Magic Square has the following properties:
Figure 7-18 The Lo Shu Magic Square
4
3
5
7
8
1
o The grid contains the numbers 1 through 9 exactly.
o The sum of each row, each column, and each diagonal all add up to the same number. This
is shown in Figure 7-19.
2.
Transcribed Image Text:11. Lo Shu Magic Square The Lo Shu Magic Square is a grid with 3 rows and 3 columns, shown in Figure 7-18. The Lo Shu Magic Square has the following properties: Figure 7-18 The Lo Shu Magic Square 4 3 5 7 8 1 o The grid contains the numbers 1 through 9 exactly. o The sum of each row, each column, and each diagonal all add up to the same number. This is shown in Figure 7-19. 2.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage