isNumber? check

Rob Hunter rob at cs.brown.edu
Mon Sep 29 07:49:59 CEST 2003


How do I check if a value is a number in Python?

One way is (x == type(1)) and (x == type(1.2)) and (x == 
type(2387482734274)) and ...

but this seems kludgy.  Any better way?

Thanks,
Rob






More information about the Python-list mailing list