Tuvas wrote:
> I need a function that will tell if a given variable is a character or
> a number. Is there a way to do this? Thanks!
> 
You can test the type of the object as follows:
>>> a='abc'
>>> isinstance(a, str)
True
>>> isinstance(a, (list, tuple))
False
>>>

The old way was to use type(a), but I think isinstance is
the new "preferred" method.

Larry Bates
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to