Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'debugger': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:number': 0.09; 'jan': 0.12; 'debugger.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'student': 0.16; 'wrote:': 0.18; 'print': 0.22; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'subject:list': 0.30; 'file': 0.32; 'subject:the': 0.34; 'point.': 0.35; 'idle': 0.36; 'shows': 0.36; 'step': 0.37; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'break': 0.61; 'name': 0.63; 'subject:get': 0.81; 'received:fios.verizon.net': 0.84; 'do:': 0.91; 'examine': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: how to get the ordinal number in list Date: Tue, 12 Aug 2014 18:01:12 -0400 References: <53E658CD.5020904@gmail.com> <53e59035$0$29998$c3e8da3$5496439d@news.astraweb.com> <338e8fb0-c9ec-462a-b560-1c1ff77de17e@googlegroups.com> <154cc342-7f85-4d16-b636-a1a953913c98@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-71-175-90-87.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407880914 news.xs4all.nl 2962 [2001:888:2000:d::a6]:44248 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76153 On 8/12/2014 1:40 PM, Neil D. Cerutti wrote: > I disagree. For a beginner, you want to be able to break things down > into individual steps and examine the result at each point. If you do: > >>>>> l= [6,2,9,12,1,4] >>>>> l2 = sorted(l,reverse=True) > > you have the advantage that you can stop after creating l2 and print it > out. The student can see that it has indeed been sorted. Or one can put the multiple steps in a file and step through with a debugger that shows local name values, like the Idle debugger. -- Terry Jan Reedy