n1=int(input("Enter n1 : "))
n2=int(input("Enter n2 : "))
l1=n1%2
if(n1%2==0):
list1=[int((n1/2-1)),int(n1/2)]
if(n1%2==1):
list1=[int(n1/2)]
if(n2%2==0):
list2=[int(n2/2-1),int(n2/2)]
if(n2%2==1):
list2=[int(n2/2)]
for i in range(n1):
for j in range(n2):
if(i in list1 and j in list2):
print("0 ",end='')
else:
print("1 ",end='')
print()
Get Answers For Free
Most questions answered within 1 hours.