From fec94604d2102b8ab977c105675c1c94cf026606 Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Sat, 1 Feb 2025 09:06:21 -0500 Subject: [PATCH] Completed 6-11 Cities --- Chapter_06/6-11_cities.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Chapter_06/6-11_cities.py diff --git a/Chapter_06/6-11_cities.py b/Chapter_06/6-11_cities.py new file mode 100644 index 0000000..a382b49 --- /dev/null +++ b/Chapter_06/6-11_cities.py @@ -0,0 +1,26 @@ +# Exercise 6-11 Cities +# Learning Objective: Nest dictionaries within dictionaries. + +cities = { + 'amsterdam': { + 'country': 'netherlands', + 'population': '920,000', + 'fact': 'Capital city, known for 420 jokes the world over.', + }, + 'dubai': { + 'country': 'united arab emirates', + 'population': '3.64 million', + 'fact': 'Dubai has the worlds tallest skyscraper.', + }, + 'new york': { + 'country': 'united states', + 'population': '8.26 million', + 'fact': 'best pizza', + }, + } + +for city, stats in cities.items(): + print(f"\nFacts about {city}:") + print(f"\tCountry: {stats['country'].title()}") + print(f"\tPopulation: {stats['population']}") + print(f"\tFun Fact: {stats['fact'].title()}") \ No newline at end of file