Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3141
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | pehache <pehache.7@gmail.com> |
| Newsgroups | fr.comp.lang.python |
| Subject | Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] |
| Date | Tue, 12 Feb 2019 00:30:44 +0100 |
| Lines | 46 |
| Message-ID | <gceet3FqhtbU1@mid.individual.net> (permalink) |
| References | <q3cff1$1e96$1@gioia.aioe.org> <q3l5gc$c31$1@gioia.aioe.org> <q3m7od$q09$1@gioia.aioe.org> <q3m851$rjm$1@gioia.aioe.org> <q3m9r8$131c$1@gioia.aioe.org> <q3n273$ija$1@gioia.aioe.org> <gc91auFkf9jU1@mid.individual.net> <q3ok8t$1b45$1@gioia.aioe.org> <gcb6drF4f7oU1@mid.individual.net> <q3pspr$kku$1@golgoth99.hacktruck.net> <gcbl3tF7kmnU1@mid.individual.net> <87va1qu9fu.fsf@izac.org> <gccn5aFegapU1@mid.individual.net> <87r2cetclv.fsf@izac.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | individual.net GW/4LxkCt9AqMOwjLnKffQ6AWpj/p/dJTaUJmPEJR+ahafPeVW |
| Cancel-Lock | sha1:0ok6jdtm7umDBtxuXpP6JQ+vmOg= |
| User-Agent | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 |
| In-Reply-To | <87r2cetclv.fsf@izac.org> |
| Content-Language | fr |
| Xref | csiph.com fr.comp.lang.python:3141 |
Show key headers only | View raw
Le 11/02/2019 à 19:16, Benoit Izac a écrit : > Bonjour, > > Le 11/02/2019 à 08:39, pehache a écrit dans le message > <gccn5aFegapU1@mid.individual.net> : > >>>> a[i:j] qui inclut l'élement i mais exclut l'élément j, j'aimerais bien >>>> qu'on m'explique la logique ? >>> >>> Cela permet d'écrire (avec i <= k <= j) : >>> >>> a[i:k] + a[k:j] == a[i:j] >>> >> >> Il est vrai que >> >> a[i:k] + a[k+1:j] == a[i:j] >> >> serait par contre abominable :-) > > Deux autres arguments : > - si tu veux les n premiers éléments : a[:n] # facile à se souvenir > - len(a[i:j]) == j - i # facile à se souvenir Je vois que les pythoneurs n'ont toujours pas résolu le problème des poteaux et des intervalles :-) > Je t'invite à lire Fluent Python qui renvoi vers cet article > <https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html> > qui indique « the nicer range 0 ≤ i < N ». Article qui contient une erreur : en Fortran l'index ne commence pas forcément à 1, mais à ce qu'on veut (le démarrage à 1 n'est que par défaut si on ne précise rien). Soit-dit en passant la convention inclus-inclus permet en Fortran d'exprimer simplement une section parcourue dans l'autre sens, avec un stride négatif et en inversant les bornes : a(i:j) --> a(j:i:-1) Avec la convention inclus-exclus ça va moins bien ; a[i:j] --> a[j-1:i-1:-1] -- "...sois ouvert aux idées des autres pour peu qu'elles aillent dans le même sens que les tiennes.", ST sur fr.bio.medecine
Back to fr.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-10 19:07 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-10 22:58 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2019-02-11 07:27 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-11 08:39 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2019-02-11 19:16 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-12 00:30 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2019-02-12 07:17 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Jean-Baptiste Faure <jbf@no-email-on-usenet.fr> - 2019-02-13 10:32 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2019-02-14 21:36 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Jean-Baptiste Faure <jbf@no-email-on-usenet.fr> - 2019-02-15 11:47 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache.7@gmail.com - 2019-02-13 02:29 -0800
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-13 19:38 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-13 22:01 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-14 06:17 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-14 09:16 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-11 07:46 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache.7@gmail.com - 2019-02-11 06:57 -0800
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-11 18:34 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Lulu <lulu042@fry.fr.invalid> - 2019-02-12 09:59 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache.7@gmail.com - 2019-02-13 03:04 -0800
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-13 19:27 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-14 09:23 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-14 10:03 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-16 14:04 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] Doug713705 <doug.letough@free.fr> - 2019-02-16 20:24 +0000
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache <pehache.7@gmail.com> - 2019-02-23 15:22 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] marco@trifouillis.com - 2019-02-14 11:16 +0100
Re: Langages [Was :[ANN] Crésus, KK Commander, Litchi] pehache.7@gmail.com - 2019-02-14 03:11 -0800
csiph-web