Python program: How to print a rectangle in Python

Python program: How to print a rectangle in Python

# Function to print a rectangle
def rectangle(rows, columns):
    for i in range(rows):
        for j in range(columns):
            print("*", end="")
        print()

# calling the function
rectangle(6, 8)

-------------------------------------------
Program Output:
********
********
********
********
********
********

Post a Comment

0 Comments