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
#Electrical Engineering
GrogVix [38]

Answer:

yes

Explanation:

where's our question

5 0
3 years ago
((11111111-1011100) X (10100 / 10))- ( 110010000+ 1110011)
dsp73

Answer:

10089891099

Explanation:

?

3 0
2 years ago
A computer program that translates a program statement by statement into machine language is called a/an?
PtichkaEL [24]
Executor. IT executes the program.
6 0
3 years ago
Answer to this if you have apex legends on either pc xbox one or PS4 for the one that answers and does gets brainliest please do
weqwewe [10]

Answer:

I got it on Ps4

3 0
2 years ago
Read 2 more answers
Host A sends real time voice to Host B over a packet switched network. Host A first converts the analogue voice signal to a digi
DiKsa [7]

Answer:

Time required is 0.007 s

Explanation:

As per the question:

Analog signal to digital bit stream conversion by Host A =64 kbps

Byte packets obtained by Host A = 56 bytes

Rate of transmission = 2 Mbps

Propagation delay = 10 ms = 0.01 s

Now,

Considering the packets' first bit, as its transmission is only after the generation of all the bits in the packet.

Time taken to generate and convert all the bits into digital signal is given by;

t = \frac{Total\ No.\ of\ packets}{A/D\ bit\ stream\ conversion}

t = \frac{56\times 8}{64\times 10^{3}}          (Since, 1 byte = 8 bits)

t = 7 ms = 0.007 s

Time Required for transmission of the packet, t':

t' = \frac{Total\ No.\ of\ packets}{Transmission\ rate}

t' = \frac{56\times 8}{2\times 10^{6}} = 2.24\times 10^{- 4} s

5 0
2 years ago
Other questions:
  • . A register in a computer has a of bits. How many unique combinations can be stored in the register?
    5·1 answer
  • You have dinner with your family and tell them that you have taken bcis. your mother tells you that she is proud of you and that
    9·1 answer
  • List and describe four communication tools that are currently popular.
    9·1 answer
  • you are concerned with security at your company and want to implement a technology that requires no configuring on the users sid
    15·1 answer
  • In the Happy Valley School System, children are classified by age as follows:less than 2, ineligible2, toddler3-5, early childho
    6·1 answer
  • If you need to add more data between column A and column B, you should _____. click in column A and paste a column click anywher
    12·1 answer
  • Assuming the Direct Hashing function and the Subtraction preprocessing algorithm is used to map keys into indices, give the inde
    15·1 answer
  • Discuss the difference between a broad internet search and a narrow internet search?
    12·2 answers
  • List all the components of a computer
    14·2 answers
  • Phishing (pronounced fishing) is malware sent through e-mail that looks like a legitimate message from a trusted sender. The goa
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!