Striped Rectangle
Given an integer number
The first line of input is an integer
In the given example the striped rectangular pattern of
7 rows and 5 columns. Therefore, the output should be
M=int(input())
N=int(input())
for i in range(M):
for j in range(N):
if (i%2==0):
print("+",end=" ")
else:
print("-",end="")
print()
Comments
Leave a comment