Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54559
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python@mrabarnett.plus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.010 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'else:': 0.03; 'odd': 0.07; 'subject:Why': 0.09; 'def': 0.12; 'be:': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'subject: \n ': 0.16; 'subject:run': 0.16; 'subject:under': 0.16; 'subject:when': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'items.': 0.19; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'suggested': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'assumes': 0.31; 'relies': 0.31; 'received:84': 0.35; 'there': 0.35; 'subject:?': 0.36; 'should': 0.36; 'changing': 0.37; 'list': 0.37; 'list.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'dave': 0.60; 'numbers': 0.61; 'skip:n 10': 0.64; 'taking': 0.65; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'subject:have': 0.80; 'reply- to:addr:python.org': 0.84; 'angel': 0.91 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.1 cv=Vd3OYjZ9 c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=0kkAYlmtguIA:10 a=CJTm3hUe6ZAA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=d1pqS0UbwCEA:10 a=fJVavL8WZ7xnQ__AOlwA:9 a=siqUZhl-yht32yrK:21 a=Q5x4kImzhhxEGvQ8:21 a=wPNLvfGTeEIA:10 |
| X-AUTH | mrabarnett:2500 |
| Date | Sat, 21 Sep 2013 17:18:32 +0100 |
| From | MRAB <python@mrabarnett.plus.com> |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? |
| References | <22b99b0a-598f-4500-9de9-5041c2ce2c8f@googlegroups.com> <CALwzidku1WQ0-+icfE+J8CjVNg4GEH4EF2Pf6cB8nCKyhDAfhQ@mail.gmail.com> <CAJsdK=JAY8gSxTyMVN+Ac2u_cwmY2PYwrTyQw1i43tPRJ+ymtw@mail.gmail.com> <mailman.168.1379632193.18130.python-list@python.org> <24104d3b-ad83-4c15-bb9e-77b61a0bac78@googlegroups.com> <XnsA241951725F1Cduncanbooth@127.0.0.1> <5398c4af-1692-4b7f-9f39-ea392d24199b@googlegroups.com> <l1k4sg$32u$1@ger.gmane.org> |
| In-Reply-To | <l1k4sg$32u$1@ger.gmane.org> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | python-list@python.org |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.229.1379780313.18130.python-list@python.org> (permalink) |
| Lines | 24 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1379780313 news.xs4all.nl 16004 [2001:888:2000:d::a6]:49773 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:54559 |
Show key headers only | View raw
On 21/09/2013 13:53, Dave Angel wrote:
[snip]
> Taking Steven's suggested code, and changing it so it uses a COPY of the
> global list;
>
> def median():
> # Relies on the global variable called List.
> # assumes there is at least one number in that list
> numbers = List.sorted()
That should be:
numbers = sorted(List)
> n = len(numbers)
> if n % 2 == 1:
> # Odd number of items.
> return numbers[n//2]
> else:
> a = numbers[n//2 - 1]
> b = numbers[n//2]
> return (a + b)/2.0
>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-19 11:46 -0700
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? John Gordon <gordon@panix.com> - 2013-09-19 18:51 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? patrick vrijlandt <patrick.vrijlandt@gmail.com> - 2013-09-19 19:08 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 13:01 -0600
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-19 20:18 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Ian Kelly <ian.g.kelly@gmail.com> - 2013-09-19 17:09 -0600
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 00:01 -0700
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Ray Wing <wrw@mac.com> - 2013-09-20 09:04 -0400
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Duncan Booth <duncan.booth@invalid.invalid> - 2013-09-20 13:39 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 22:59 -0700
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? William Bryant <gogobebe2@gmail.com> - 2013-09-20 23:07 -0700
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-09-21 10:25 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 12:53 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? MRAB <python@mrabarnett.plus.com> - 2013-09-21 17:18 +0100
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? Dave Angel <davea@davea.name> - 2013-09-21 18:09 +0000
Re: Why does it have red squiggly lines under it if it works perfectly fine and no errors happen when I run it? alex23 <wuwei23@gmail.com> - 2013-09-23 10:39 +1000
csiph-web