Project 2: A simple second project for
working with lists and files.
Due:
Oct 3rd at 11:59pm
(but I'll assign project3 in the class earlier that day)
Summary:
In this project you will open a file, and print some but not all of the
contents.
Details:
For this project,
- First create a new project in pycharm
- Next get this sample text file, and put it
into your main folder for your project.
- I will use a similar but larger file to
test your project
- open the file and read the whole thing in
- this file contains Country population and size data, we want to use
that to calculate the population per square km
- each line is in the format Country Name:Population in
Millions:Square Kilometers
- so for each line in the file print out the the name of the country and
the result of dividing the population (remember to convert to Millions)
by the number of square kilometers.
Hints:
for this you likely want to use the string split, f-strings, for-each
through a list etc.
Of course put this into git and onto github sooner rather than later.
Submission:
As with the previous project, to submit
the project to me, share it with me on github. My github id is jsantore.
You can see directions for doing this here.