Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #54559
| Date | 2013-09-21 17:18 +0100 |
|---|---|
| From | MRAB <python@mrabarnett.plus.com> |
| 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 | (3 earlier) <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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.229.1379780313.18130.python-list@python.org> (permalink) |
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