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>Try this:</p>

<pre><code>    z = 0
while z != "gg you win, noob":
    try:
       x = int(input("Insert a numer: "))
       while x != 4:
           print("incorrect")
           x =int(input("Insert another number: "))

       if x == 4:
            z = "gg you win, noob"
            print(z)

    except:
        print('Only input numbers')
</code></pre>

<p>This will convert all your input values into integers. If you do not input an integer, the <code>except</code> statement will prompt you to only input numbers, and the <code>while True</code> loop will repeat your script from the beginning instead of raising an error.</p>

python