Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!border2.nntp.ams2.giganews.com!backlog4.nntp.ams3.giganews.com!backlog4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.034 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:error': 0.03; 'missed': 0.12; '(x,': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'item:': 0.16; 'index': 0.16; 'wrote:': 0.18; 'example': 0.22; 'print': 0.22; 'header:User- Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'something': 0.35; 'message-id:@gmail.com': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'read': 0.60; 'subject:This': 0.74; 'subject:interesting': 0.84; 'vital.': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Sun, 31 Aug 2014 22:15:58 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: This could be an interesting error References: <2jc70at4qcpqmbes72r2f0tsjk8up0j6mn@4ax.com> In-Reply-To: <2jc70at4qcpqmbes72r2f0tsjk8up0j6mn@4ax.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409544968 news.xs4all.nl 2948 [2001:888:2000:d::a6]:54490 X-Complaints-To: abuse@xs4all.nl X-Original-Bytes: 2848 Xref: csiph.com comp.lang.python:77389 On 08/31/2014 06:04 PM, Seymore4Head wrote: >> for x,letter in enumerate(word): >> # x is index (position), letter is the value at that index >> if letter in "AEIOUaeiou": > I tried changing: > for x in range(len(test)): > to > for x in enumerate(test): Read my example again. You missed something vital. enumerate returns both a position and the item: for x,letter in "hello": print (x, " ", letter)