Create n strings in Python
<p>I get a number (n) from user. 
Just</p>

<pre><code>n = int(input())
</code></pre>

<p>After that, I have to to create <strong>n</strong> strings and get their values from user.</p>

<pre><code>i = 0;

while (i &lt; n):
    word = input() # so here is my problem: 
                   # i don't know how to create n different strings
    i += 1
</code></pre>

<p>How to create <strong>n</strong> strings?</p>

<p>If you are aware of <a href="http://www.secnetix.de/olli/Python/list_comprehensions.hawk" rel="nofollow">list comprehensions</a>, you can do this in a single line</p>

<pre><code>s = [str(input()) for i in range(int(input()))] 
</code></pre>

<p>int(input()) - This gets the input on the number of strings. Then the for loop is run for the input number of iterations and str(input()) is called and the input is automatically appended to the list 's'. </p>

python