Reflection: Find the data type : Reflection « Development « Python
- Python
- Development
- Reflection
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