Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #4572

Re: [Python-de] Wo ist der Fehler

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail
From Dinu Gherman <gherman@darwin.in-berlin.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Wo ist der Fehler
Date Wed, 2 Nov 2016 11:56:10 +0100
Lines 84
Message-ID <mailman.51.1478084700.17234.python-de@python.org> (permalink)
References <85B72761-2E99-4B83-88B9-588A1467C6D0@gmail.com> <496101aa-65f7-e529-73e9-75f22a56260f@mail.de> <B0BEAC01-A5E8-48D7-822B-0DECE812D6BC@darwin.in-berlin.de>
Mime-Version 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de U2GEbSrXMy3sBrWGoWF6MwIFj22Ehlq5+BArHsf4kxWA==
Return-Path <gherman@darwin.in-berlin.de>
X-Original-To python-de@python.org
Delivered-To python-de@mail.python.org
X-Envelope-From gherman@darwin.in-berlin.de
In-Reply-To <496101aa-65f7-e529-73e9-75f22a56260f@mail.de>
X-Mailer Apple Mail (2.3124)
X-BeenThere python-de@python.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Die Deutsche Python Mailingliste <python-de.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-de/>
List-Post <mailto:python-de@python.org>
List-Help <mailto:python-de-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <B0BEAC01-A5E8-48D7-822B-0DECE812D6BC@darwin.in-berlin.de>
X-Mailman-Original-References <85B72761-2E99-4B83-88B9-588A1467C6D0@gmail.com> <496101aa-65f7-e529-73e9-75f22a56260f@mail.de>
Xref csiph.com de.comp.lang.python:4572

Show key headers only | View raw


On 02 Nov 2016, at 10:23, Sven R. Kunze <srkunze@mail.de> wrote:
> 
> On 02.11.2016 10:06, Mario Schröder wrote:
>> Hi 👋
>> 
>> Bei einem meiner ersten Coding Aufgabe habe ich gleich mal einen Fehler, den ich seit drei Wochen mit mir rumschleppe und nicht weiter kommen ;-(
>> 
>> Also das Problem liegt in der If Schleife soviel weiß ich schon ...
>> 
>> Kann mir jemand mit dem ganzen Zaun winken ???
>> 
>> Check out my code on Repl.it:  https://repl.it/EDUE/3
>> 
>> Mit freundlichen Grüßen
>> 
>> Mario Schröder
> 
> 
> Meinst du den Fehler?
> 
> 
> The current paragraph reads as such:
> 
> Python uses dynamic typing and a mix of reference counting and a cycle-detecting garbage collector for memory management. An important feature of Python is dynamic name resolution (late binding), which binds method and variable names during __2__ execution.Python uses __3__ indentation to delimit blocks - rather than curly braces or keywords. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.[54] This feature is also sometimes termed the off-side rule.
> What is the correct filling in for __2__ ?  runtime
> Traceback (most recent call last):
>  File "python", line 134, in <module>
>  File "python", line 125, in playing_the_game
>  File "python", line 85, in filling_blanks
>  File "python", line 105, in showing_phrases
> UnboundLocalError: local variable 'prompt' referenced before assignment
> 
> 
> Ich würde mal sagen: in den Zeilen 96 bis 101 solltest du die Variable "Prompt initilialisieren. ;)
> 
> Beispiel:
> 
> prompt += 'xx'
> 
> 
> Wenn prompt nicht initialisiert wurde, dann kann nichts dazu addiert werden. Macht das Sinn?
> 
> 
> Gefühlt scheinst du lokale und globale Variablen in der Funktion showing_phrases zu mixen. Ich denke, es wäre gut, das zu vermeiden.
> 
> 
> Schickes Console-Game! +1

Hallo zusammen!

Hier mein neuer Vorschlag für eine konstruktive Standardantwort: ;-)

- http://www.oreilly.com/programming/free/how-to-make-mistakes-in-python.csp
- http://www.oreilly.com/programming/free/files/how-to-make-mistakes-in-python.pdf

Mehr davon kann man sich mit einem noch nicht so ganz fertigen Tool von mir besorgen (irgendwann bekommt es dann auch sein eigenes Repo):

https://github.com/deeplook/scrape-fu/tree/master/freebora

Happy coding!

Dinu

Back to de.comp.lang.python | Previous | Next | Find similar


Thread

Re: [Python-de] Wo ist der Fehler Dinu Gherman <gherman@darwin.in-berlin.de> - 2016-11-02 11:56 +0100

csiph-web