Reflection: Find the data type : Reflection « Development « Python






Reflection: Find the data type

Reflection: Find the data type
from types import *
 
def what (x):
     if type(x) == IntType:
             print "This is an int."
     else:
             print "This is something else."
 
what(4)
what("4")


           
       








Related examples in the same category