Files
pythonkurs/teil5/dict/iter_kfz.py
Raspithek 3d8cb9128d Teil 6 "Objekte ist neu
Repository aufgeräumt.
2023-02-24 06:41:05 +01:00

24 lines
356 B
Python

# 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)