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
How to make a project using PID and thermacouple
Andrei [34K]

Explanation:

Required tools and components:

Soldering iron

Solder

Flux pen

Fine gauge solder (23 gauge or finer)

Wire cutter

MAX31855 thermocouple interface chip (available directly from Maxim Integrated)

Thermocouple with junction suitable for your application (e.g., probe, washer, etc.)

J-type (-40°C to +750°C)

K-type (-200°C to +1350°C)

T-type (-200°C to +350°C) Solid state relay (will depend on your application)

USB FTDI 5V cable (Note: A single cable can be used for many different microcontroller projects)

Computer with Arduino IDE v1.0

Wall-wart 9V/1.5A, 2.1mm center positive

6 0
3 years ago
Which is the process that a wireless router uses to translate a private ip address on internal traffic to a routable address for
luda_lava [24]
<span>The process that a wireless router uses to translate a private ip address on internal traffic to a routable address for the internet is </span>Network address translation<span> (NAT).  It is a method of relabeling one </span>IP address<span> space into another by altering network </span>address<span> information in IP header of packets while they are in transit across a </span>traffic routing<span> device. </span>
7 0
3 years ago
What kind of a bug is 404 page not found
Allisa [31]

Answer:A 404 error is often returned when pages have been moved or deleted. ... 404 errors should not be confused with DNS errors, which appear when the given URL refers to a server name that does not exist. A 404 error indicates that the server itself was found, but that the server was not able to retrieve the requested page.

Explanation: Hope this helps

7 0
3 years ago
Read 2 more answers
A newspaper wants to estimate the proportion of Americans who will vote for Candidate A. A random sample of 1000 voters is selec
Finger [1]

Answer:

The correct answer to the following question will be "NORM.S.INV".

Explanation:

  • The NORM.IN.V function in Excel determines the opposite of the Cumulative Standard Distribution Function for just a value of x which is given, and the standard deviation and mean of the distribution provided. The probability of NORMINV(mean, probability, standard deviation).
  • In Excel 2010, the standard. S. Inv function is new and is therefore not easily accessible in Excel's earlier versions.

Therefore, NORM.S.INV is the right answer.

5 0
3 years ago
Of the people working in concert with security teams to ensure data quality and protection, the head of information management i
Svet_ta [14]

Answer:

true

Explanation:

because Internet

because Internet

3 0
3 years ago
Other questions:
  • Design and write an object-oriented program for managing inventory bins in a warehouse. To do this you will use two classes: Inv
    5·1 answer
  • How many packets does your computer send/receive in a single mouse click when you visit a website?
    6·1 answer
  • The create_python_script function creates a new python script in the current working directory, adds the line of comments to it
    9·1 answer
  • Janice, who is 15, posts a picture of herself drinking alcohol and making an obscene gesture on her social networking page. Whic
    11·2 answers
  • ____________ is a script or a tool that obtains privileges of a root
    8·1 answer
  • If you do not want to keep a change made by the autocorrect feature, you can click the ____ button on the auto correction option
    12·1 answer
  • How come I haven't moved to the next rank even though I have all of the right things to move on?
    10·2 answers
  • Should the federal government have bug bounty programs? Why or why not?
    9·2 answers
  • If a computer uses 500 characters, how many bits this system requires to give different code to all characters?
    15·1 answer
  • Resource _____ let you view, manage, and automate tasks on multiple aws resources at a time.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!