Get the input from the user for the number of rows and columns.
Print 0 in the row one.
Print 1 in the row two.
Case= Test 1
input=
5
5
output=
00000
11111
00000
11111
00000
m = int(input("Enter number of lines: "))
n = int(input("Enter number of columns: "))
for i in range(m):
for j in range(n):
if (i == 0) or (i % 2 == 0):
print('0', end='')
else:
print('1', end='')
print()
Comments
Leave a comment