Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:skip:c 10': 0.07; 'subject:question': 0.08; 'received:mail-qc0-f174.google.com': 0.09; 'cc:addr:python-list': 0.10; 'mixture': 0.16; 'oct': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'back.': 0.22; 'kevin': 0.23; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; 'subject:list': 0.28; "i'm": 0.29; 'url:python': 0.32; 'docs': 0.33; 'mixed': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'faster': 0.35; 'said,': 0.35; 'doing': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'cc:no real name:2**1': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'header:Received:5': 0.40; 'real': 0.61; 'reply': 0.66; 'url:tutorial': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HTjkIDfBPB7keRPgPjehEDbpCqetOFyWFgx6ZZOIjtc=; b=KQtR38UVLdG/vsVQbWFfruKNPvfT+BM2IDGandY716kfdc/2q+dBFv3RUc4PQrWAB9 fXgy4JzfA/KftMGBoPz1wx+mtWwi5Rk//W6v8xstgoK68FyBObLQDxRbiMTc8YV5JFIM Dak3s3hksCjKqvQL7FiofWbkVKa3RNpXw8WBC5JouyXirNeBUYEdvHxBHcbO9DrpeIms 3shySwHDa9vmYr8iZZApQPrfSBnqIGt4TSgOsYKL+eAVuBNnUiwKK2o/2aX6P/nKn27i 0fMGdUcB5sAFKOEE9X3kbJiKVoBeQz/YCldARVUAghVPwnlhFsuUAr0fFVPlY0Yk+WJy vtaQ== MIME-Version: 1.0 In-Reply-To: References: <507E145E.9060008@davea.name> Date: Wed, 17 Oct 2012 01:09:08 -0400 Subject: Re: list comprehension question From: Dwight Hutto To: Kevin Anthony Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org, d@davea.name X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350450551 news.xs4all.nl 6868 [2001:888:2000:d::a6]:49160 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31463 On Wed, Oct 17, 2012 at 12:43 AM, Kevin Anthony wrote: > Is it not true that list comprehension is much faster the the for loops? > > If it is not the correct way of doing this, i appoligize. > Like i said, I'm learing list comprehension. > I thought it was matrix multiplication mixed with list comprehension. Check this out real quick from the docs for list comprehension, but if it's a mixture of matrix multi, and list comp, then reply back. http://docs.python.org/tutorial/datastructures.html#list-comprehensions -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com