Reflection: Find the data type : Reflection : Development : Python examples (example source code) Organized by topic

C++
PHP
Python
Python Home »  Development   » [  Reflection  ]  Screenshots 
 



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
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.