[Tutor] question re type()

Alan Gauld alan.gauld at btinternet.com
Sat Oct 27 14:03:18 CEST 2007


"Dick Moores" <rdm at rcblue.com> wrote

> if type(n) == 'int' or type(n) == 'long':
>   do something

don't use strings

if type(n) == int

Or just use an instance of the same type:

if type(n) == type(42)

Alan G.



More information about the Tutor mailing list