#Python Help

5 messages · Page 1 of 1 (latest)

gaunt dome
#

I have to write some code for uni, unfortunately i dont aktually know, what to do...
I wrote the firt part of code, but idk how to write the next part. (Look at the pic for the constructions)
the part i wrote:
worter= {"0": "null",
"1": "eins",
"2": "zwei",
"3": "drei",
"4": "vier",
"5": "fünf",
"6": "sechs",
"7": "sieben",
"8": "acht",
"9": "neun",
"10": "zehn" }
zahl= input("Bitte geben sie eine positive Zahl ein: ")
print(zahl)

gaunt kindleBOT
#

Thanks for your question :clap:, if someone gives you an answer it would be great if you thanked them with a :white_check_mark: in response. This response will earn you both points for special roles on this server.

gaunt dome
#

worter= {"0": "null", #dictionary erstellen, und als key die ziffern verwenden, value ist das ausgeschriebene "1": "eins", "2": "zwei", "3": "drei", "4": "vier", "5": "fünf", "6": "sechs", "7": "sieben", "8": "acht", "9": "neun", "10": "zehn" } zahl= input("Bitte geben sie eine positive Zahl ein: ") print(zahl)

high mason
#

My spontanius solution would be to just iterate over your numbers and then just print the equivalent of your dictionary.

#

Here a solution, marked as spoiler in case you just wanted a tip:

||

for nummer in zahl:
    print(woerter[nummer])

||