You can use the type() function: ### >>> s='hello' >>> type(s) <type 'str'> >>> type(s)==str True >>> n=1 >>> type(n) <type 'int'> >>> type(n)==int True ###
You can do the same with list, too. So you could write, if type(x)==list: #do list action /c -- http://mail.python.org/mailman/listinfo/python-list