Answer to Question #287912 in Python for Suresh

Question #287912

Hallow rect angle

1
Expert's answer
2022-01-16T04:20:01-0500
def print_rectangle(n, m) :
     
    for i in range(1, n+1) :
        for j in range(1, m+1) :
            if (i == 1 or i == n or
                j == 1 or j == m) :
                print("*", end="")           
            else :
                print(" ", end="")           
         
        print()
 
 
# Driver program for above function
rows = 6
columns = 20
print_rectangle(rows, columns)

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