<div class="gmail_quote"><div>Hi Alan,</div><div>I appreciate the tip. Using the operator module does look better, the speed is about the same too.</div><div><br></div><div>Thanks.</div><div>Abasiemeka</div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 04 Jul 2012 18:13:36 +0100<br>
From: Alan Gauld &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt;<br>
To: <a href="mailto:tutor@python.org">tutor@python.org</a><br>
Subject: Re: [Tutor] Bothersome NoneType Error for a List object<br>
Message-ID: &lt;jt1tk0$fnd$<a href="mailto:1@dough.gmane.org">1@dough.gmane.org</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 04/07/12 17:01, Osemeka Osuagwu wrote:<br>
<br>
&gt;      lcm = reduce(lambda x, y: x*y, templist)     #my first lambda<br>
&gt; expression! (multiply all members of templist<br>
<br>
Congratulations :-)<br>
<br>
But you could have done:<br>
<br>
import operator<br>
lcm = reduce(operator.mul, templist)<br>
<br>
instead.<br>
<br>
--<br>
Alan G<br>
Author of the Learn to Program web site<br>
<a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a><br>
<br></blockquote></div>