How to know it is a list?

Cliff Wells logiplexsoftware at earthlink.net
Mon Sep 10 17:02:04 EDT 2001


On Monday 10 September 2001 13:44, Henry wrote:
> Hi guys,
>   I have a newbie question. How do check if a variable is a list?

Two ways:

if type(a) == type([ ])

or

from types import *
if type(a) is ListType

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list