Python Loop To Print Asterisks Based on User Input
<p>I'm trying to create a python program to print a certain number of asterisks based on user input. My code is below</p>

<pre><code>num_stars = 3
num_printed = 0

while num_printed &lt;= num_stars:
    print('*')
</code></pre>

<p>The output is an infinite loop. I want to print the number of stars variable as asterisks.</p>

<p>If you don't want to use a loop here. Maybe do something like this:</p>

<pre><code>stars = int(raw_input('number of stars: '))

star_list= ['*' for i in range(stars)]

print ' '.join(['%s' % i for i in star_list])
</code></pre>

python