Python: Can't get correct data type
<p>I am new to Python programming. 
I encountered a problem in one of the exercises and can't think of a way out.
So, I have to check whether an input is "int" or "float" and return it's absolute value. An error message otherwise.
 I chose to use 'raw_input()' to accept an input from the user, but the problem is that it accepts inputs as a string. again, I am new to Python so please excuse me if this question seems to be dumb, but I really need help with this.
I have added  the question and my code too.
Thanks!!</p>

<p>Question:</p>

<p>This is a two-parter: first, define a function, distance_from_zero, with one parameter (choose any parameter name you like).
Second, have that function do the following:
Check the type of the input it receives.
If the type is int or float, the function should return the absolute value of the function input.
If the type is any other type, the function should return "This isn't an integer or a float!"</p>

<p>Code:</p>

<pre><code>def distance_from_zero(n):
    n=raw_input("Please enter a number:")
    if type(n)==int or type(n)==float:
        print abs(n)
    else:
        print "This isn't an integer or a float!"
</code></pre>
