dict_in_dict.py
country_capitals = {"India" : "New Delhi", "Bangladesh" : "Dhaka", "France" : "Paris"}
numbers = {1 : "One", 2: "Two"}
my_dictionary = {"countryCapitals": country_capitals, "numbers" : numbers}
for key in my_dictionary.keys():
print(f"{key} -> {my_dictionary[key]}")
Output
$ python3 dict_in_dict.py
countryCapitals -> {'India': 'New Delhi', 'Bangladesh': 'Dhaka', 'France': 'Paris'}
numbers -> {1: 'One', 2: 'Two'}
No comments:
Post a Comment