Python input never equals an integer
<p>I want to insert a number and if I put any number other than 4 it will tell me it's wrong, but if it's false it will tell me "gg you win, noob.". However when I insert 4, it tells me it's incorrect.</p>

<pre><code>x = input("Insert a numer: ")

while x != 4:
   print("incorrect")
    x =input("Insert another number: ")

if x == 4:
    print("gg you win, noob")
</code></pre>

<p>Python 2 and 3 differ in the function <code>input()</code>.</p>

<ul>
<li>In Python 2, <code>input()</code> is equivalent to <code>eval(raw_input())</code>.</li>
<li>In Python 3, there is no <code>raw_input()</code>, but <code>input()</code> works like Python 2's<code>raw_input()</code>.</li>
</ul>

<p>In your case:</p>

<ul>
<li>In Python 2, <code>input()</code> gives you <code>4</code> with type <code>int</code>, so your program works.</li>
<li>In Python 3, <code>input()</code> gives you <code>'4'</code> with type <code>str</code>, so your program is buggy.</li>
</ul>

<p>In Python 3, one way to fix this is to use <code>eval(input())</code>. But using <code>eval</code> on an untrusted string is very dangerous (yes your program works dangerously in Python 2). So you should validate the input first.</p>

python