Read a list of cities from a file named "Cities.txt" and store them in a Python list of dictionaries. Cities.txt: New York City, United States, 8,175,133 Tokyo, Japan, 13,929,286 London, United Kingdom, 8,982,000 Shanghai, China, 24,183,000 Mumbai, India, 12,478,447 Mexico City, Mexico, 8,918,653 Output all the cities in your list. Output all cities with a population greater than 10 million. Output all cities located in Asia. Calculate the average population of all cities in your list. Create a histogram of the countries. Each element in the histogram should represent the count of cities in a specific country. Take all the cities in "Cities.txt" and store them in a Python set of tuples where each tuple represents (city name, country). Output all unique countries represented among the cities. Output the total number of entries in your set.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I know you guys are using AI. Don't you dare give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.
Read a list of cities from a file named "Cities.txt" and store them in a Python list of
dictionaries.
Cities.txt:
New York City, United States, 8,175,133
Tokyo, Japan, 13,929,286
London, United Kingdom, 8,982,000
Shanghai, China, 24,183,000
Mumbai, India, 12,478,447
Mexico City, Mexico, 8,918,653
Output all the cities in your list.
Output all cities with a population greater than 10 million.
Output all cities located in Asia.
Calculate the average population of all cities in your list.
Create a histogram of the countries. Each element in the histogram should represent
the count of cities in a specific country.
Take all the cities in "Cities.txt" and store them in a Python set of tuples where each
tuple represents (city name, country).
Output all unique countries represented among the cities.
Output the total number of entries in your set.
Transcribed Image Text:Read a list of cities from a file named "Cities.txt" and store them in a Python list of dictionaries. Cities.txt: New York City, United States, 8,175,133 Tokyo, Japan, 13,929,286 London, United Kingdom, 8,982,000 Shanghai, China, 24,183,000 Mumbai, India, 12,478,447 Mexico City, Mexico, 8,918,653 Output all the cities in your list. Output all cities with a population greater than 10 million. Output all cities located in Asia. Calculate the average population of all cities in your list. Create a histogram of the countries. Each element in the histogram should represent the count of cities in a specific country. Take all the cities in "Cities.txt" and store them in a Python set of tuples where each tuple represents (city name, country). Output all unique countries represented among the cities. Output the total number of entries in your set.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education