determine variable type

Paul Rubin http
Thu Aug 18 15:07:24 EDT 2005


MCollins at seminolecountyfl.gov writes:
> i tried using type(var) but that only seemed to produce a response in the 
> command line.
> 
> is there a built in python function to determine if a variable is an 
> integer?

type(var) returns the type.  For example:

   if type(x) == type(3):
      print 'x is an integer'



More information about the Python-list mailing list