Write a program to print a rectangle pattern of M rows and N columns using the characters as shown below.
The first line of input is an integer
M. The second line of input is an integer N.
In the given example,
3 rows and 10 columns. Therefore, the output should be
+----------+
| |
| |
| |
+--------- +
M = int(input())
N = int(input())
print('+'+'-'*N+'+')
for i in range(M):
print('| |')
print('+'+'-'*N+'+')
Input:
3
10
Output:
+----------+
| |
| |
| |
+----------+
Comments
Leave a comment