Die Suche ergab 3 Treffer
- Donnerstag 8. Juni 2017, 21:49
- Forum: Allgemeine Fragen
- Thema: Bundesland in Dictionary einfügen
- Antworten: 6
- Zugriffe: 1390
Re: Bundesland in Dictionary einfügen
ich benutze python 3.1. return dict war nur ein Tippfehler. Ich wollte dicti zurückgeben
- Donnerstag 8. Juni 2017, 21:00
- Forum: Allgemeine Fragen
- Thema: Bundesland in Dictionary einfügen
- Antworten: 6
- Zugriffe: 1390
Re: Bundesland in Dictionary einfügen
Es kommt übrigens immer ein NameError heraus. z.b. "Wien is not defined."
- Donnerstag 8. Juni 2017, 20:56
- Forum: Allgemeine Fragen
- Thema: Bundesland in Dictionary einfügen
- Antworten: 6
- Zugriffe: 1390
Bundesland in Dictionary einfügen
Ich habe ein leeres Dictionary. In dem muss ich die Bundesländer einfügen. Doch wie mache ich das? Mein Code funktioniert nämlich nicht.
def bundeslandeinfuegen():
dicti = {}
bundesland = input("Gib das Bundesland ein! ")
while bundesland:
new = {bundesland}
if bundesland not in dicti:
dicti ...
def bundeslandeinfuegen():
dicti = {}
bundesland = input("Gib das Bundesland ein! ")
while bundesland:
new = {bundesland}
if bundesland not in dicti:
dicti ...