Teil 6 "Objekte ist neu
Repository aufgeräumt.
This commit is contained in:
23
teil5/dict/iter_kfz.py
Normal file
23
teil5/dict/iter_kfz.py
Normal 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)
|
Reference in New Issue
Block a user