1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
coldgirl [10]
3 years ago
15

There is a simple method for constructing a magic square for any odd value of n:

Computers and Technology
1 answer:
DaniilM [7]3 years ago
3 0

Answer:

See Explaination

Explanation:

class MagicSquare():

def __init__(self,side):

self.side=side

self.two_dimension=[]

for row in range(1,side+1):

row_line=[]

for col in range(1,side+1):

row_line.append(0)

self.two_dimension.append(row_line)

def display(self):

row=0

col=int((self.side-1)/2)

for i in range(1,self.side**2+1):

self.two_dimension[row][col]=i

row-=1

col+=1

if row==-1:

row=self.side-1

if col==self.side:

col=0

if self.two_dimension[row][col]==0:

continue

else:

row+=1

if row==self.side:

row==0

for line in self.two_dimension:

for num in line:

print("{0:>3}".format(num),end=" ")

print()

def main():

for i in range(1,14,2):

square=MagicSquare(i)

square.display()

print("----------------------------------------------------")

if __name__ == '__main__':

main()

You might be interested in
Similarly, the Windows server OS can run regular workstation applications such as MS Office or Adobe Photoshop. Why is this a ba
aniked [119]

Answer:

It affects the system speed

Explanation:

The normal windows server OS can run the regular workstation applications like the MS Office or the Adobe Photoshop. Photoshop is an editor that have one of its function as being an editor that helps to edit the picture itself by changing the pixels or edit anything in the image.

On the other hand, Ms Office would help to crop or resize or adjust the brightness etc.

When it comes to cropping or reducing/increasing the brightness of the images then Office is of agreat help as it is free where as for photo shop advanced editing to the images can be done.There is the situation where both needs to be used.

Also running both the application on a egular workstation would make the system slow and also both the applications would not be required at the same time at many times.

8 0
3 years ago
what is the restaurant with the black pom tree and yellow backround three letter name from hi guess the restaurant
vekshin1
In 'N' Out, and KFC (Kentucky Fried Chicken)
7 0
3 years ago
Read 2 more answers
Make The PYTHON Code<br><br> print first 3 character of a string - given "Seattle" expected "Sea"
vlada-n [284]

This program uses a conditional to determine if seafood is safe to consume.

IF (seafood = "mollusk" OR daysFrozen ≥ 7) { rating ← "safe" } ELSE { rating ← "unsafe" }

In which situations will rating be "safe"?

️Note that there may be multiple answers to this question.

Choose all answers that apply:Choose all answers that apply:

1. When sea food is mollusk and day frozen is 1

2.When sea food is mollusk and day froze is 9

3. When see food salmon and day frozen is 7

<em>Did that help?</em>

6 0
2 years ago
Give three examples of NON-TRADITIONAL web authoring tools<br> 3 pour
olganol [36]
Some other type of authoring tools 1. Card or Page based tools 2. Icon based, event driven tools 3. Time based and presentation Tools.
4 0
2 years ago
How to realize dynamic balance of planar closed-chain leg mechanism?​
Alexxandr [17]

The common belief is that Closed Chain exercises are the preferred rehabilitation for anterior cruciate ligament (ACL) injury because of increased strain.

5 0
2 years ago
Read 2 more answers
Other questions:
  • HELP I don't understand this
    14·2 answers
  • 10.
    13·1 answer
  • How does Hadoop work? It breaks up Big Data into multiple parts so each part can be processed and analyzed at the same time on o
    5·1 answer
  • Markup is best defined as
    11·1 answer
  • When you arrive at work one morning, your inbox is full of messages complaining of a network slowdown. you collect a capture fro
    12·1 answer
  • if you're using the paintbrush tool and want to change the color of the paint being used what should you change
    9·2 answers
  • What is the difference between line art and continuous tone copy?
    14·1 answer
  • Please answer <br><br> Steps 1-6 <br><br> Visual basics
    7·1 answer
  • Explain in your own words how remote-access Trojans (RATs) work. How can these be used by attackers? How would a network adminis
    10·1 answer
  • Hello everyone! can anybody help me? i need help with computing.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!