> My first question is how do I test if a variable is a number or a string? I > need to to do this for error checking on values passed into methods. type(), as in hex_num = "DECAFBAD" long_num = long(hex_num, 16) print type(hex_num) print type(long_num) returns <type 'str'> <type 'long'>