List comprehension using multiple lists
<p>I was unable to determine a Pythonic way for generating a list using list comprehension from multiple lists.  I'm trying to generate a list that implements the following function:</p>

<p>vbat = Vmax - a + b + c</p>

<p>Where Vmax is a constant but a, b and c are lists.  I was hoping I could do something that's easy to read like this:</p>

<pre><code>vbat = [Vmax - x + y + z for x in a and y in b and z in c]
</code></pre>

<p>I know that I can use the map operator to make a new combined list and then use a list comprehension on the new list but it seems a little ugly and hard to read.  The code that I know would work is shown below:</p>

<pre><code>newlist = map(sub,map(add,b,c),a)
vbat = [Vmax + x for x in newlist]
</code></pre>

<p>Is there a solution to this that is friendlier for the reader?  Thanks in advance.</p>

<p>The <code>zip</code> function can combine multiple lists into a sequence of tuples:</p>

<pre><code>[Vmax - a_el + b_el + c_el for (a_el, b_el, c_el) in zip(a, b, c)]
</code></pre>

python list