Berufsschule/S1/LF5/2021-12-20_Hauptstädte.py

26 lines
414 B
Python

hauptstädte = {}
print("** Datenerfassung **")
while True:
print("Bitte Land eingeben")
land = input()
if land == "":
break
print("Bitte Stadt eingaben")
stadt = input()
hauptstädte[land] = stadt
print("** Datenabfrage **")
while True:
print("Bitte Land eingeben")
land = input()
if land == "":
break
if land in hauptstädte:
print(hauptstädte[land])
else:
print("Land existiert nicht")