Reflection : Reflection : Development PYTHON examples


PYTHON examples » Development » Reflection »

 

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 Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Reflection