How about:<br>
<br>
>>> [pow(2,x) for x in [1,2,3,4]]<br>
<br>[2, 4, 8, 16]<br>
<br>
<br><div><span class="gmail_quote">On 2/14/06, <b class="gmail_sendername">Michael Broe</b> <<a href="mailto:mbroe@columbus.rr.com">mbroe@columbus.rr.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I read somewhere that the function 'map' might one day be deprecated<br>in favor of list comprehensions.<br><br>But I can't see a way to do this in a list comprehension:<br><br> >>> map (pow, [2, 2, 2, 2], [1, 2, 3, 4])
<br>[2, 4, 8, 16]<br><br>Is there a way?<br><br>Cheers,<br>Mike<br>_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">
http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>