I need this done by wednesday at 10 in the morning for my programming python class.
Goal
Utilize functions, selection structures, loops, strings, files, and a dictionary in one Python program
Instructions
Read everything before doing anything!
Write a program named [login to view URL] that works with information about large cities.
Your program will open the [login to view URL] the document file. Each line in the file has the name of a city, its country, and its population. The first few lines of the file look like this:
Alexandria,Egypt,3811516
Ankara,Turkey,3517182
Bangkok,Thailand,5104476
Barcelona,Spain,1621537
Your program will read this file and create a dictionary where the key is the city name and the value is a list that contains the country and population. The part of the dictionary corresponding to the first few lines would look like this:
{
'Alexandria': ['Egypt', 3811516],
'Ankara': ['Turkey', 3517182],
'Bangkok': ['Thailand', 5104476],
'Barcelona': ['Spain', 1621537]
}
The program will print the total number of cities and the average population.
(Added on 10 Dec 2020) To determine the average, you need the sum of all the city populations. You can calculate the sum and total number of cities as you are building the dictionary.
However, if you would like more experience with dictionaries, you can do it another way: First, build the dictionary. Then, write a separate loop that iterates through the dictionary to calculate the sum of all the populations. (The len() function will get you the number of cities.)
Your program will then ask the user to repeatedly enter city names, or just press ENTER to quit. If the city is in the dictionary, the program prints the city name, country name, and population. If the city is not in the dictionary, the program prints a message that says that.
Your program must define and use a function named capitalize_city(). This function will take a string and capitalize each word in the string, leaving the rest in lower case. Thus:
capitalize_city('chicago') → 'Chicago'
capitalize_city('BOSTON') → 'Boston'
capitalize_city('aUsTiN') → 'Austin'
capitalize_city('san jose') → 'San Jose'
This allows users to enter city names in any combination of upper and lower case that they want; capitaize_city() will convert the city name to the format that the dictionary uses.
Sample Output
Here is what your program output might look like:
Number of cities: 75
Average population: 3,447,506
Enter a city, or just ENTER to quit: chicago
Chicago is in USA and has a population of 2,695,598.
Enter a city, or just ENTER to quit: Paris
Paris is in France and has a population of 2,138,551.
Enter a city, or just ENTER to quit: san jose
San Jose is not in the list, sorry.
Enter a city, or just ENTER to quit: san diEgo
San Diego is in USA and has a population of 1,307,402.
Enter a city, or just ENTER to quit:
Hello,
Sir i have read your project and its match with my skills i can provide you quality work on time
Can you please come to the chat box so we can easily discuss about project details..
I Can build apps using new technologies like Laravel, Node, React, Mongo, Firebase, Heroku and many more...
I love to work hard and satisfy my Client. I will be willing to work with you Soon... My Skill set is : Php, laravel, CodeIgniter, React, Node, MongoDB, Javascript, JQuery, Ajax, Jason HTML5, Css3, FlexBox, CSS grid, SCSS, Bootstrap PSD Conversion...
Android, IOS with React Native, Ionic, PhoneGap and any Hybrid app.
Dear sir.I am a web programming expert but I am very familiar with python language.I have already worked for 6 years dealing with finiancial and python projects.I've checked your attached project and I am very interested in your project.
When do you need the project finished by?
----------------------------------------------
Hope to meet and have a talk.
please contact me and discuss more detail
Thank you.
Hello. I am a Python Expert and have rich experience for 10 years. I am confident in the algorithms, data structures.
I will ensure the best quality of the project and meet deadlines.
Kindly contact me and let us discuss in more detail.
Thank you.
Hi I am here ready to do your assignment work it's preety eaasy for me as i did already many of the assigment like this
contact me to do this work
Thanks
Waqas
Hi, dear! I appreciate your job posting and hope you are doing great.
I'm a Python developer with good experiences working on such projects as yours.
I have finished many projects similar to yours, so I can help you perfectly.
Hope to discuss more details in chatting.
Thank you.
I have read your description and I am so interested in your project.
I am confident in your project and I can finish it clearly on time.
I am well experienced and skillful Python/C/C++ programmer.
I have +5 years of experience in software development.
I have finished a lot of projects like this.
I ensure the best quality of your project and to keep your deadline.
Please contact me kindly and let us discuss in more detail.
Working with me, you will have a good experience and a good friend and save more time and money.
Best regards!
Good day,
I will gladly help you with your Python assignment. At this point I do not have any questions, as the project description states clearly what you need. The project should only take me a day, so it would be finished at the latest Tuesday night (your time). This will give you enough time to test it if you like or want any changes to be made. Let's dicuss further details via chat.
Greetings
Matthias
Hi,
I am a python expert. I have experience on python's List,Dict,Tuple,Files,Arrays,Quesue,stack,etc many data structures. I have understood your requirement and can deliver within 24 hours.
Lets connect in chat for more discussion.
Hello, while reading your project description it really jumped out at me , i can help you in completion of the project you described and i do have good experience with python as per i have done project with bpython for my clients before specially students.
I have strong feeling that i can do that with in a day before your project/class timing, consider replying me so that we can discuss about the project details if required (any extra details) or i can start right away with your project and mark it done with in 24 hours or before that.
Hope to get a reply from your side so we can settle things and start project ASAP.
Greets
Hi, i´m an Python expert and i can help you with your project finishing it before your deadline, send me a message if you´re interested. Thanks for you post.
Python Developer and Expert in file processing. (Almost half of your work is done voluntarily)
You will be provided with complete code and welcome for any number of free revisions if required.
I may give you demo for free to help you understanding the code if you need.
Hopefully seeking for the acceptance of the proposal to get your task done.