title: Printing "Wrong Type" when calling a function with the wrong input type - Python
body: <p>I'm trying to make an error message appear when the wrong type of data is entered into a function. In this instance, I am only trying to accept an <code>int</code> or <code>float</code> when the function is called. Entering a <code>str</code> in the function should return an error message</p>
  
  <pre><code>def isPrime(i):
  
      if not (type(i)==float or type(i)==int):
          print("Input wrong type")
          return None
  
      i = abs(int(i))
  
      if i == 2 or i == 1: 
          return True    
  
      if not i &amp; 1: 
          return False
  
      for x in range(3, int(i**0.5) + 1, 2):
          if i % x == 0:
              return False
  
      return True
  
  # Wanting the code to return an error
  isPrime(bob) 
  </code></pre>