Question:
Python
Write nested loops to print a rectangle. Sample output for given program:* * * * * * |
Answer:
![]() |
EDITABLE CODE:
#Variable declaration
num_rows=2
num_cols=3
#For loop for number of rows
for p in range(num_rows):
#For loop for number of columns
for q in range(num_cols):
# Display the statement
print ('*',end= ' ')
#next statement
print('')
0 Comments: