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
A simple C program to find the logarithm of any number in any base.....​
elena-s [515]

Answer:

tera bur mast hai jwjvszvVbzNjz

8 0
2 years ago
Which tab is used to configure editing restrictions in Word 2016? Review References Security Developer
Ipatiy [6.2K]

Answer:

Review Tab is the correct answer to the given question .

Explanation:

Giving the permission to file in word 2016

  • Click on the Review tab and select the restrict tab .
  • Chose the option allow this type of editing .
  • After that choose the option No changes .
  • Pick the section of the document they want to authorize the adjustments.
  • After that there are multiple option are seen select accordingly  as user need and press ok button .
  • Click on the start permission there is option is seen Start enforcement and press the button option start Enforcing Protection.
  • After that feeding the password if the user need the password is in encrypt form then press encrypt option and click ok .

If the user need to read the file

  • Click on the Review tab and select the restrict tab .
  • After that choose the option "Stop Protection" .
  • Giving the password you are feeding in the permission of file  .
  • Finally the user will edit the document

4 0
3 years ago
Read 2 more answers
How to make the heart symbol in photoshop
sveta [45]
Click the font drop-down box in the tool settings bar. Select "Arial." 6. Press "Alt-3" using your keyboard number pad's "3" key to insert the heart symbol<span>.</span>
3 0
3 years ago
Read 2 more answers
Write a program that accepts 5 number and arrange them in ascending order​
Schach [20]
5
5 does this help?
5
5
5
7 0
3 years ago
1st answer will get brainliest!
valentina_108 [34]

The answer is program!

5 0
2 years ago
Read 2 more answers
Other questions:
  • When you park facing downhill and there is a curb, turn your wheels _____ the curb. When you park facing uphill and there is a c
    13·2 answers
  • It is okay to use a dust rag when cleaning the inside of a computer.
    9·2 answers
  • An example of how a merge field will appear in a document is ______.
    7·2 answers
  • What is the automotive name for the large wires that allow more electrical current to flow ?
    12·1 answer
  • If you have a windows 8, but want the features of windows 8 pro, purchase and install _______.
    7·1 answer
  • A user is implementing security on a small office network. Which two actions would provide the minimum security requirements for
    10·1 answer
  • "What is the database in which Windows stores all information about hardware, applications, users and system settings?"
    8·1 answer
  • 2. What is the name for an action performed by the VR Robot?
    7·2 answers
  • How do people decide their ethical behavior
    13·2 answers
  • In cryptocurrency, a block is only considered valid if it has a.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!