You can accept the assignment here.
In large measure, this week's homework rehashes your work with salaries in week 1. You'll answer the same questions, but use python to do so.
Even if you are familiar with it, please do not use pandas
.
You will then create a few simple pictures, using methods of the "turtle" class.
The assignment is due Wednesday October 18th at 1:30am.
A copy of the salaries.csv
files is included directly in your homework checkout, so that we'll all be working on the same copy.
You now have salaries.csv in your homework directory.
The scripts q*py
suggests formatting for stepping through these questions.
Fill you answers in, there following the format exactly -- we'll check this with a computer.
All of the "salaries" questions require the same pre-formatting.
You should implement that formatting a single time with a function in helper.py
,
which you can import into the q*.py
files.
The individual question files will in turn just do some list comprehension,
and set the solution
variable.
Hint: you've done this before. You're answers had better match!
- Which salaried worker makes the most?
- How many employees does the city list?
- How many full-time workers are there in the file?
- How many part-time workers are there in the file? (Check you work for 1, with 2 and 3.)
- What is the highest hourly wage in the city?
- Excluding the top three workers (who are doctors), what is the highest hourly wage?
- How many people work for the police department?
- How many of them are detectives?
- How much does the median fireperson (employee of the fire department) make? (Note that in HW 1 this was modal.)
- What are the most common women's names for police officers (incl. detectives)? There are 37 occurrences.
Turtles can recuperate lost points, but not get you above 100%.
Consult the documentation for the python turtle
module:
https://docs.python.org/3.6/library/turtle.html
Using turtle and taking the pictures below as your model, fill in t*.py
to create
- A pentagonal "tunnel"
- A checkerboard
I do not expect an exact match on the tunnel, but it should have 5 "sides" and spiral outwards.
The angle-dependent shading and rotating squares are "bonuses."
When you're all done, commit and push the code:
git add *py *ps # add the relevant files
git status # check that all your modified files are listed
git commit -m "phewff, all done!"
git push
Now go online to your GitHub page (with substitutions!), to check that everything is there:
You should have committed eleven salaries files (helper.py
and q0.py
to q9.py
), plus any of the turtle files (t1.py
and t2.py
, and checkerboard.ps
and pentagon_tunnel.ps
).
Make sure it's in before Wednesday October 18th at 1:30am!