How to tell if function was passed a list or a string?

Roy Smith roy at panix.com
Wed May 17 17:50:55 EDT 2006


In article <1147900957.466840.192390 at i40g2000cwc.googlegroups.com>,
 "rh0dium" <steven.klass at gmail.com> wrote:

> The question is how do you tell that the data you were passed is a list
> or not?

>>> x = []
>>> isinstance (x, list)
True



More information about the Python-list mailing list