subject
Computers and Technology, 08.01.2020 11:31 kers

The magic square is a grid with 3 rows and 3 columns with the following properties: • the grid contains every number from 1 to 9. • the sum of each row, each column, and each diagonal all add up to the same number. this is an example of a magic square: 4 9 2 3 5 7 8 1 6 you can simulate a 3x3 grid using a two-dimensional list. for example, the list corresponding to the grid above would be: [[4, 9, 2], [3, 5, 7], [8, 1, 6]] write a function that accepts a two-dimensional list as an argument and returns whether the list represents a magic square (either true or false). create a program that tests the function on the following two-dimensional lists and prints out the results each on a separate line: [[4, 9, 2], [3, 5, 7], [8, 1, 6]] [[2, 7, 6], [9, 5, 1], [4, 3, 8]] [[1, 2, 3], [4, 5, 6], [7, 8, 9]] [[4, 9, 2], [3, 5, 5], [8, 1, 6]]

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Write a function processpeople() that takes the name of a file as a parameter. each line of the file corresponds to information about a person. in particular a line contains either a name (in the form lastname,firstname with no spaces in it) or a name (lastname,firstname) and a year. the function will process the file, creating a person object for each line in the file. the function will print information about each line as it processes it, as well as appending the new person object into a list. make sure to use person methods to display information rather than recreating the work you did for the first problem. once the entire file has been processed, the function returns the list of person objects created from the file. if the file is empty, the function should return an empty list. if the input file cannot be opened, the function should print a message to that effect and then return an empty list. the following shows what would be displayed for two example files which have been provided in the link. the file none.txt does not exist. note that your function must work on an arbitrary file that consists of valid lines. you cannot assume anything about the file except that it contains lines that have the format described above.
Answers: 2
question
Computers and Technology, 21.06.2019 22:40
State the parts of a variable declaration?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
You know the right answer?
The magic square is a grid with 3 rows and 3 columns with the following properties: • the grid cont...
Questions
question
Mathematics, 16.04.2021 19:50
question
Physics, 16.04.2021 19:50
question
Mathematics, 16.04.2021 19:50
question
Mathematics, 16.04.2021 19:50
question
Mathematics, 16.04.2021 19:50
question
English, 16.04.2021 19:50