Computer Science, asked by Rajeshwari31, 4 months ago

write a program in python to print the pattern
please do give the whole program code.​

Attachments:

Answers

Answered by subgb98
2

Answer:

This code is written in python 3

n=int(input())

for i in range(n):

   if i%2==0:

       a=0

       b=1

   else:

       a=1

       b=0

   for j in range(n):

       if j%2:

           print(a ,end=" ")

       else:

           print(b, end=" ")

   print()

Similar questions