[Tutor] Integer?

John Fouhy john at fouhy.net
Wed Dec 6 03:09:49 CET 2006


On 06/12/06, Luke Paireepinart <rabidpoobear at gmail.com> wrote:
> Eli Zabielski wrote:
> > How can I check if a variable is an integer?
> if type(aVar) == type(1):

Well, you could also do "type(aVar) == int", which is clearer.

Or "type(aVar) in (int, long)", depending on exactly what you mean by "integer".

-- 
John.


More information about the Tutor mailing list