reducer.py

Find question 4 here: https://docs.google.com/document/d/1YDBYMIRllI47sjttXsGyo12qLOYHAOpUJsJFF_12g9M/edit