title: How to I control type of data on Python?
body: <p>I have a question about python. I have to control type of data. I wrote a code but when I enter a string data, its not working. Whats wrong with about that code?</p>
  
  <pre><code>a=input("enter sth: ")
  if type(eval(a))== int :
      print(a, "is a number")
  elif type(eval(a))==float:
      print(a," is a number")
  elif type(a)== str:
      print(a, "is a str")
  </code></pre>
  
  <p>When I enter string, it gives this error.</p>
  
  <pre><code>    Traceback (most recent call last):
    File "C:\Users\Alper\Desktop\merve.py", line 2, in &lt;module&gt;
      if type(eval(a))== int :
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  </code></pre>
  
  <p>NameError: name 'g' is not defined</p>