Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #6071
| Path | csiph.com!news.swapon.de!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail |
|---|---|
| From | Marcel Logen <333200007110-0201@ybtra.de> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: [Python-de] Zuweisung via return |
| Date | Wed, 3 Jul 2024 00:09:15 +0200 |
| Organization | Bureau Logen |
| Message-ID | <20240702tu220915@o15.ybtra.de> (permalink) |
| References | <7324215d-fbce-490c-97de-f0a825e85780@online.de> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=fixed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Wed, 3 Jul 2024 00:09:15 +0200 |
| Injection-Info | tota-refugium.de; logging-data="121549"; mail-complaints-to="abuse@news.tota-refugium.de" |
| User-Agent | flnews/1.3.0pre4 (for GNU/Linux) |
| Cancel-Lock | sha1:8MW8W/KNss+egrCHpbaeemYOMTw= |
| X-User-ID | eJwFwQERADEIAzBLD78WJocr4F/CEvw0Kg7Bg8VOROl6NEOBZLdGA3xAT4t5/fiulSkrvR4q+BGn |
| X-Face | "fwa)nkI|OHw\Gs)=OT'+594UGH/2apvTo@f2XuHJez*Di<:P/1[R3k*V[j)+?33~rJ`j7#df`0;#<OLE$19c6.n^:b~K71~o_s>TN\[_|NW^,ldljxRR#-+|U@"*o\dt/$995I5nf:zrJCPVrlr7~Mq7 |
| Xref | csiph.com de.comp.lang.python:6071 |
Show key headers only | View raw
Andreas Röhler in de.comp.lang.python: >Die untenstehende Funktion soll die Länge einer Liste berechnen. len(liste) >Leider gelingt es nicht, das Ergebnis einer Variablen "a" zuzuweisen. >Diese erhält "None". >Hat jemand eine Idee? Das "return" darf wohl nicht in der zweiten Ebene innerhalb der Funktion stehen, sondern muß in der ersten erscheinen. <https://docs.python.org/3/reference/simple_stmts.html#the-return-statement> | user15@o15:/tmp$ cat ll.py | #!/usr/bin/python3 | def listenlaenge(li): | z=0 | while li!=[]: | z+=1 | li=li[1:] | return z | | g=[53,535,2,3,7,64,356,3452] | | a=listenlaenge(g) | print(a) | user15@o15:/tmp$ ./ll.py | 8 | user15@o15:/tmp$ Marcel (Lines: 39) -- │ ╭─╮ ╭─╮ ╭────╮ ..63..╭───────────────╮ ╰─╮ │ ╰──╯ ╰────╮ ╭─╯ │ ..68.. ╰──╮ ╭─────────╯ ╭─ ╰───╯ ╭────────╯ │ ╭───╯ ╭─╮ ╭──────╯ ╰─╮ ╭─╮ ╭────────╮ │ ...4..╰──────────╯ ╰──────────╯ ╰─╯ ╰─╯ ╰──╯ ╰───╯
Back to de.comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
[Python-de] Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-02 20:56 +0200
Re: [Python-de] Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-02 23:02 +0200
[Python-de] Re: Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-03 16:28 +0200
Re: [Python-de] Re: Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-03 16:36 +0200
Re: [Python-de] Re: Zuweisung via return Hermann Riemann <nospam.ng@hermann-riemann.de> - 2024-07-03 21:14 +0200
Re: [Python-de] Re: Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-04 00:09 +0200
Re: [Python-de] Zuweisung via return Marcel Logen <333200007110-0201@ybtra.de> - 2024-07-03 00:09 +0200
Re: [Python-de] Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-03 10:39 +0200
[Python-de] Re: Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-03 11:21 +0200
Re: [Python-de] Zuweisung via return Stephan Herrmann <stephan.herrmann@mailbox.org> - 2024-07-03 00:22 +0200
[Python-de] Re: Zuweisung via return Hartmut Goebel <h.goebel@crazy-compilers.com> - 2024-07-03 11:14 +0200
Re: [Python-de] Re: Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-03 13:43 +0200
[Python-de] Re: Zuweisung via return Hartmut Goebel <h.goebel@crazy-compilers.com> - 2024-07-03 14:41 +0200
Re: [Python-de] Re: Zuweisung via return "Peter J. Holzer" <hjp-usenet4@hjp.at> - 2024-07-03 15:40 +0200
[Python-de] Re: Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-04 13:43 +0200
Re: [Python-de] Re: Zuweisung via return Hermann Riemann <nospam.ng@hermann-riemann.de> - 2024-07-05 05:47 +0200
[Python-de] Re: Zuweisung via return Hartmut Goebel <h.goebel@crazy-compilers.com> - 2024-07-05 10:48 +0200
Re: Zuweisung via return Hermann Riemann <nospam.ng@hermann-riemann.de> - 2024-07-05 16:08 +0200
[Python-de] Re: Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-03 14:02 +0200
[Python-de] Re: Zuweisung via return Frank Grellert <grellert@web.de> - 2024-07-03 23:43 +0200
[Python-de] Re: Zuweisung via return Andreas Röhler <andreas.roehler@online.de> - 2024-07-04 13:35 +0200
csiph-web