How to check if an element of a list is a list (in Python)?
<p>If we have the following list:</p>

<pre><code>list = ['UMM', 'Uma', ['Ulaster','Ulter']]
</code></pre>

<p>If I need to find out if an element in the list is itself a list, what can I replace <em>aValidList</em> in the following code with?</p>

<pre><code>for e in list:
    if e == aValidList:
        return True
</code></pre>

<p>Is there a special import to use?  Is there a best way of checking if a variable/element is a list?</p>
