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()
Where are the options and the dialog
A spoofing attack. "<span>a situation in which one person or program successfully masquerades as another by falsifying data, thereby gaining an illegitimate advantage."</span>
Answer:
Make main function
def main():
Make some constants for the grades
A = 5.0 or 4.0
B = 4.0 or 3.0
C = 3.0 or 2.0
D = 2.0 or 1.0
F = 1.0 or 0.0
In the main function call the function you made and make sure to use those constants for help
also don't forget to call your main function or nothing will work
Explanation:
Making the main function is good programming practice for your future
Making the constants is also helpful to your programming.
Now how it works you call the function you wrote to calculate the grade.
I don't know how helpful this was this is one of my first answers. I am `also answering how I would do it