Python Program to Print Rectangular Pattern

This python program generates or prints rectangular pattern made up of stars up to n lines.

Python Source Code: Rectangular Pattern


# Rectangular pattern in Python

# Reading number of rows and columns
row = int(input("Enter number of rows: "))
col = int(input("Enter number of columns: "))

print("Rectangular pattern is: ")
for i in range(1,row+1):
    for j in range(1,col+1):
        print("*", end="")
    print()

Output: Rectangular Pattern

Enter number of rows: 4
Enter number of columns: 12
Rectangular pattern is: 

************
************
************
************