How to get only numbers as a response in python?
<p>I'm very new to python, in fact, to programming in general. I'm trying to do a program that compares three numbers and determines which one is smaller. I got the code done, but now i need to make it only accept numbers, and still running when it finds a literal value. For example, code will be ok if you put any number, but when you type a string value it crashes. here is the code </p>

<pre><code>num1=0;
num2=0;
num3=0;

num1=int((raw_input("Type below the first number \n")));
num2=int((raw_input("Type below the second number\n")));
num3=int((raw_input("Type below the third number \n")));

if (num1&lt;num2) and (num1&lt;num3):
    print "%i is the smallest number of all three"% num1;
elif (num2&lt;num1) and (num2&lt;num3):
    print "%i is the smallest number of all three"% num2;
elif (num3&lt;num2) and (num3&lt;num1):
    print "%i is the smallest number of all three"% num3;
elif (num1==num2) or (num1==num3) or (num2==num3):
    print "Two equal numbers have been written.";
</code></pre>