505,068 views
40 votes
40 votes
Given the number of rows and the number of columns, write nested loops to print a rectangle.

User Daria Pydorenko
by
2.9k points

1 Answer

15 votes
15 votes

Answer:

You need to use a nested for loop. Use the range() builtin to produce an iterable sequence. The outer for loop should iterate over the number of rows.

Explanation:

Use the range() builtin to produce an iterable sequence. The outer for loop should iterate over the number of rows overtime.

User Dskinner
by
2.6k points