Teil 6 "Objekte ist neu

Repository aufgeräumt.
This commit is contained in:
2023-02-24 06:41:05 +01:00
parent c21159f36f
commit 3d8cb9128d
34 changed files with 196 additions and 0 deletions

23
teil5/dict/iter_kfz.py Normal file
View File

@@ -0,0 +1,23 @@
# encoding utf-8
kfz = {
'W':'Wuppertal',
'HH':'Hamburg',
'D':'Düsseldorf',
'DO':'Dortmund',
'H':'Hannover',
'M':'München'}
for key in kfz:
print(f' Kennzeichen {key} -> Stadt {kfz[key]}')
print()
for key, stadt in kfz.items():
print(f' Kennzeichen {key} -> Stadt {stadt}')
items = kfz.items()
keys = kfz.keys()
print(items)
print(keys)

12
teil5/dict/kfz.py Normal file
View File

@@ -0,0 +1,12 @@
# encoding utf-8
kfz = {
'W':'Wuppertal',
'HH':'Hamburg',
'D':'Düsseldorf',
'DO':'Dortmund',
'H':'Hannover',
'M':'München'}
print(kfz)
print(kfz['W'])