product_of_elems = functools.reduce(<spanclass="hljs-keyword">lambda</span> out, x: out * x, <collection>)
list_of_chars = list(<str>)
</code></pre>
<pre><codeclass="python language-python hljs">index = <list>.index(<el>) <spanclass="hljs-comment"># Returns first index of item or raises ValueError.</span>
<pre><codeclass="python language-python hljs"><bool> = <el><spanclass="hljs-keyword">in</span><collection><spanclass="hljs-comment"># For dictionary it checks if key exists.</span>
index = <list>.index(<el>) <spanclass="hljs-comment"># Returns index of first occurrence or raises ValueError.</span>
<list>.insert(index, <el>) <spanclass="hljs-comment"># Inserts item at index and moves the rest to the right.</span>
<el> = <list>.pop([index]) <spanclass="hljs-comment"># Removes and returns item at index or from the end.</span>
<list>.remove(<el>) <spanclass="hljs-comment"># Removes first occurrence of item or raises ValueError.</span>