Write a program to print a rectangle pattern of M rows and N columns using the plus character (+).

PHOTO EMBED

Fri Nov 04 2022 18:45:47 GMT+0000 (Coordinated Universal Time)

Saved by @codewithakash

m = int(input())
n = int(input())

counter = 0
while counter < m:
  print("+ " * n)
  counter = counter + 1
content_copyCOPY

Logical Approach: The questions asked here are similar to that of the ones in Coding practice-7 Solid Rectangle. Read two inputs in the integer type. Initialize a variable with a value of 0. Using the while condition check if the count < M, when the count is greater than M, then the loop will terminate. You have to print the star followed by the space ' + ' as N times. After printing increment count with value 1. Feel free to reach out to us if you have any other queries. Mark the discussion as clarified if your issue is resolved. Happy Learning!!!