Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > fr.comp.lang.python > #3650
| Path | csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!fdn.fr!news.ortolo.eu!news.izac.org!reader |
|---|---|
| From | Benoit Izac <use.reply.to@INVALID.ADDRESS> |
| Newsgroups | fr.comp.lang.python |
| Subject | Re: print |
| Date | Fri, 26 Nov 2021 08:15:36 +0100 |
| Message-ID | <875ysf1j6v.fsf@izac.org> (permalink) |
| References | <61a08538$0$3730$426a34cc@news.free.fr> |
| Reply-To | benoit.izac@free.fr |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | keg.izac.org; logging-data="32233"; mail-complaints-to="usenet@izac.org" |
| Xref | csiph.com fr.comp.lang.python:3650 |
Show key headers only | View raw
Bonjour, Le 26/11/2021 à 07:56, ast <ast@invalid> a écrit dans le message <61a08538$0$3730$426a34cc@news.free.fr> : > si je fais: > >>>> for i in range(5): > i > > > 0 > 1 > 2 > 3 > 4 > > j'ai bien l'affichage de i > > mais si je fais la même chose dans une fonction: > >>>> def test(): > for i in range(5): > i > > >>>> test() >>>> > > Je n'ai rien. Pourquoi ? J'imagine que dans le premier cas, i est renvoyé à chaque itération à l'interpréteur, alors que dans le second cas, c'est renvoyé à la fonction et vu qu'elle ne renvoie rien, tu n'as rien. -- Benoit Izac
Back to fr.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
print ast <ast@invalid> - 2021-11-26 07:56 +0100
Re: print Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2021-11-26 08:15 +0100
Re: print Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2021-11-26 14:04 +0100
csiph-web