Python Nested Loops To Print Rectangle With Asterisks
<p>Write nested loops to print a rectangle. Sample output for given program:</p>

<p>3 stars   :   ***</p>

<p>3 stars   :   ***</p>

<p>I tried it and ended up with this:</p>

<pre><code>num_rows = 2

num_cols = 3

'''IDK WHAT TO PUT HERE'''
    print('*', end=' ')
print('')
</code></pre>

<p>Any help would be appreciated! Thanks!</p>

<p>You're trying to learn, I think, so a here is a hint to push you in the right direction.</p>

<p>You need to use a nested <code>for</code> loop. Use the <a href="https://docs.python.org/3/library/functions.html#func-range" rel="nofollow"><code>range()</code></a> builtin to produce an iterable sequence.</p>

<p>The outer for loop should iterate over the number of rows. The inner (nested) for loop should iterate over the columns.</p>

python nested-loops