Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3482
| Path | csiph.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Thu, 29 Apr 2021 14:38:33 -0500 |
| Newsgroups | fr.comp.lang.python |
| Subject | Somme, récursive |
| X-poster | PEAR::Net_NNTP v1.5.0 (stable) |
| From | raph14 <nospam_rgb.baralle@gmail.com.invalid> |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | 8bit |
| Organization | !No_Organization! |
| Message-ID | <48-dnbOA4f2klhb9nZ2dnUU7983NnZ2d@giganews.com> (permalink) |
| Date | Thu, 29 Apr 2021 14:38:33 -0500 |
| Lines | 19 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-ljf2ln27+N4nZBgORcvC7lF8y9YAaWQSd2HE9itEFMsHWbaIqx6Ihlx/ACMv7hMJ8clswqQYBYXTph0!TDBI67yLBtADHxMLWNhsrbeXTqmUk5APEUw+BOSYfB1WxXSf+VtzVDqXKTdHKeWTD31r6iQAVw0l |
| X-Complaints-To | abuse@giganews.com |
| X-DMCA-Notifications | http://www.giganews.com/info/dmca.html |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Lines | 18 |
| X-Original-Bytes | 1574 |
| Xref | csiph.com fr.comp.lang.python:3482 |
Show key headers only | View raw
Bonjour,
J'essaie de faire une question de mon DM de NSI mais problème, je bloque. Aider
moi svp :,)
Il faut faire la somme de (4,7,5,5,2,6,9,3,8,4) en utilisant une récursivité.
Voici la question:
"Implémenter une fonction récursive max_pyr(pyramide) retournant la somme
maximale de la
pyramide."
Je n'y arrive pas j'ai essayé en créent cela:
def max_pyr(liste):
somme=0
if len(liste)<=0:
return somme
else:
somme+=liste[0]
liste.del[0]
return (max_pyr(liste),somme)
Mais rien cela ne marche pas...
Aider moi svp
Back to fr.comp.lang.python | Previous | Next — Next in thread | Find similar
Somme, récursive raph14 <nospam_rgb.baralle@gmail.com.invalid> - 2021-04-29 14:38 -0500
Re: Somme, récursive Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2021-04-29 22:38 +0200
Re: Somme, récursive Dominique <zzz@aol.com.invalid> - 2021-04-30 07:02 +0200
Re: Somme, récursive Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2021-04-30 12:07 +0200
Re: Somme, récursive raph14 <nospam_rgb.baralle@gmail.com.invalid> - 2021-04-30 09:56 -0500
Re: Somme, récursive raph14 <nospam_rgb.baralle@gmail.com.invalid> - 2021-04-30 09:57 -0500
Re: Somme, récursive Olivier Miakinen <om+news@miakinen.net> - 2021-04-30 17:06 +0200
Re: Somme, récursive Olivier Miakinen <om+news@miakinen.net> - 2021-04-30 17:17 +0200
Re: Somme, récursive Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2021-04-30 18:14 +0200
Re: Somme, récursive raph14 <nospam_rgb.baralle@gmail.com.invalid> - 2021-04-30 11:46 -0500
Re: Somme, récursive Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2021-04-30 20:09 +0200
Re: Somme, récursive raph14 <nospam_rgb.baralle@gmail.com.invalid> - 2021-04-30 14:04 -0500
Re: Somme, récursive Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2021-04-30 21:15 +0200
Re: Somme, récursive debimax <debimax@free.fr> - 2021-04-30 15:03 +0200
Re: Somme, récursive Dominique <zzz@aol.com.invalid> - 2021-04-30 18:46 +0200
Re: Somme, récursive debimax <debimax@free.fr> - 2021-04-30 22:05 +0200
Re: Somme, récursive Dominique <zzz@aol.com.invalid> - 2021-05-01 04:39 +0200
csiph-web