To complete this lab you will need to add a .py
script that contains your code (be sure it is well commented!) and edit this README file.
You can write your script using whatever tools you like, but it must include a comment block at the top with the following information:
- Name:
- Date created:
- Version of Python you are using
- Very brief description of the assignment or the assignment name. Include inputs and outputs.
You should edit your README file to provide the following information:
- Summarize what your script does or the problem you were trying to solve.
- Summarize any major errors you encountered and what sources they used to resolve the errors
- How you fixed the errors, or where the error is if you couldn't figure something out.
Remember that you are encouraged to look for answers online! Stackoverflow, other Github repositories, or Python documentation are all good places to start.
This week you will create a small dictionary of Refugee and iterate through it to create basic outputs.
- Review the data table located under the Refugee camps by country and population section: https://en.wikipedia.org/wiki/Refugee_camp
- Create a dictionary with 5 key-value pairs consisting of a country name and an integer that represents the number of refugees in refugee camps in the selected country, for a year of your choice. The dictionary should represent country names as keys and the population as values.
- Define a function that will print out just the countries' names, by looping through the keys of your dictionary.
- Define a function that will print out just the populations, by looping through the values of your dictionary.
- Print out a series of statements telling how many refugees are in each country: "CountryX has 1234567 refugees."
Revise your output, if necessary. Make sure there is an introductory sentence or comment describing the output for each loop you write.