How can I verify if the content of a variable is a list or a string?

Andres Soto soto_andres at yahoo.com
Wed Feb 1 01:44:12 CET 2012


Hi,
I'm writing a function which receive a list which elements are strings or new lists (sublists) containing strings. 

How can I verify if sone element of the list (which is contained in a variable) is a list or a string?
I found the method isinstance(object,class) but I don't know which class should I use for.
Thank you, regards

 
Prof. Dr. Andrés Soto
DES DACI
UNACAR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120131/7e26005c/attachment.html>


More information about the Python-list mailing list