-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathU4_6_Dictionary.py
More file actions
executable file
·41 lines (34 loc) · 980 Bytes
/
Copy pathU4_6_Dictionary.py
File metadata and controls
executable file
·41 lines (34 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
####################################################
#
# Uebung:
# Erstellen Sie ein Dictionary mit folgenden Angaben:
# 1234-1 Zopf
# 2345-1 Gipfeli
# 3456-1 Tessiner
# 4567-1 Weggli
# Lesen Sie das Dictionary ein und erzeugen Sie damit folgende Ausgabe
# Art.Nr Artikel
# 1234-1 Zopf
# 2345-1 Gipfeli
# 3456-1 Tessiner
# 4567-1 Weggli
#
####################################################
#### Lösung: ####
# KI-Prompt
# Erstelle ein Python Script, welches folgende Aufgaben erfüllt:
# - Erstellen Sie ein Dictionary mit folgenden Angaben:
# 1234-1 Zopf
# 2345-1 Gipfeli
# 3456-1 Tessiner
# 4567-1 Weggli
# - Lesen Sie das Dictionary ein und erzeugen Sie damit folgende Ausgabe
# Art.Nr Artikel
# 1234-1 Zopf
# 2345-1 Gipfeli
# 3456-1 Tessiner
# 4567-1 Weggli
artikel = {"1234-1":"Zopf","2345-1":"Gipfeli","3456-1":"Tessiner","4567-1":"Weggli"}
print("Art.Nr Artikel")
for artnr,art in artikel.items():
print(artnr, art)