Answer to Question #221422 in Python for Hari nadh babu

Question #221422

Striped Rectangle


This Program name is Striped Rectangle. Write a Python program to Striped Rectangle


The below link contains Striped Rectangle question, explanation and test cases


https://drive.google.com/file/d/1S7V-_Rle5eyT53qc6RBlwfpo3MzdknUH/view?usp=sharing


We need exact output when the code was run

1
Expert's answer
2021-08-03T03:44:24-0400
M = int(input())
N = int(input())


rectangle = []
for row in range(M):
    if row % 2 != 0:
        rectangle.append(' '.join(['-' for _ in range(N)]))
    else:
        rectangle.append(' '.join(['+' for _ in range(N)]))
print('\n'.join(rectangle))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS