Simple if/elif statement + raw_input why dosen't work
<p>I have a problem with simple if statement. I want user to press a key '1','2' or '3' to choose any option then program will do something. For a test it just prints  text for example "Wybrano 2" after pressing '2'.</p>

<p>Here is my code:</p>

<pre><code>if raw_input() == '1':
        print "Wybrano 1"

elif raw_input() == '2':
        print "Wybrano 2"

elif raw_input() == '3':
        print "Wybrano 3"
</code></pre>

<p>So if I press 1 it correctly prints "Wybrano 1" but when I press 2 or 3 the program does  nothing. </p>

<p><strong>When i press 2 or 3 program does not nothing</strong> is wrong. It is waiting for you for next input.</p>

<p>Let me tell you how this is working.</p>

<ul>
<li><code>raw_input</code> is python function for accepting user input.(I know you are aware of this :) )</li>
<li>When you execute code, first it will go to "<code>if</code>" statement. <code>'if'</code> statement has <code>'raw_input'</code> function after it. So, it waits for your input.</li>
<li>When you enter '1', <code>"1" = "1"</code>, it gives you expected output and come out of code.</li>
<li>However, next time when you again execute code, again <code>'raw_input'</code> after <code>'if'</code> is executed waiting for your input. When you input '2' and since <code>'1' == '2'</code> is false, code goes to next <code>'elif'</code> statement. After <code>'elif'</code> there is <code>'raw_input'</code> function which is waiting for input again. </li>
<li><strong>Therefore, you got feel, program does nothing.</strong></li>
<li>Same happens when you enter '3'.</li>
</ul>

<p><strong>Example of above explained behavior</strong></p>

<pre><code>if raw_input("Enter number : ") == '1':

    print "Wybrano 1"
elif raw_input("Enter number : ") == '2':

    print "Wybrano 2"
elif raw_input("Enter number : ") == '3':

    print "Wybrano 3"
</code></pre>

<p><strong>Output:</strong></p>

<pre><code>C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 1
Wybrano 1

C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 2
Enter number : 2
Wybrano 2

C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 3
Enter number : 3
Enter number : 3
Wybrano 3
</code></pre>

<p><strong>How to make your code working ?</strong></p>

<p>Answer is simple. As explained by <strong>@MooingRawr</strong> in first comment, just save user input in some variable and then check.</p>

<pre><code>x = raw_input("Enter number : ")
if  x == '1':
    print "Wybrano 1"
elif x == '2':
    print "Wybrano 2"
elif x == '3':
    print "Wybrano 3"
</code></pre>

<p><strong>Output:</strong></p>

<pre><code>C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 1
Wybrano 1

C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 2
Wybrano 2

C:\Users\dinesh_pundkar\Desktop&gt;python c.py
Enter number : 3
Wybrano 3

C:\Users\dinesh_pundkar\Desktop&gt;
</code></pre>

python python-2.7