Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 : Magic Square ( 4 0 marks ) Write a program ( magic _ square.py ) that will read a sequence of values
Question : Magic Square marks
Write a program magicsquare.py that will read a sequence of values from the user. The
values should consist of digits from the set dots, and at most one The program must
check if the could be replaced by a digit so that the numbers make a by magic square. If
there is no then it should check if the digits make a magic square. It will display the numbers
in a by matrix if possible. It will then inform the user if the matrix makes a magic square or
not. A magic square is a matrix of numbers where the sum in any direction is the same rows
columns, and diagonals and the square contains the numbers from to the number of squares
in this case, the numbers to each one exactly once Design and break down your program
into different functions.
See the output below as a guide. Your program must be consistent with the sample run. Note
that the digits may be unseparated, or they may be separated by any character that is not a digit
or an
Sample run :
Magic Square Checker
Please enter the numbers through :
Numbers do not make a square of size
Sample run :
Magic Square Checker
Please enter the numbers through : x
Numbers do not make a square of size
Sample run :
Please enter the numbers through :
The square is magical!
Sample run :
Magic Square Checker
Please enter the numbers through :
The square is magical!
Sample run :
Magic Square Checker
Please enter the numbers through :
using python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started