Update task1.py

Hi Dave and Chris,

       Thank you for sending me this interesting assignment. I did the similar assignment when I studied in university. This gave me a chance to rework the assignment using Python.

       I first implemented a clumsy method for task1 for purpose of practising Python while I usually designed machine learning algorithms for classification and NLPS tasks using Java and weka. 

       Because I have a travel to Toronto for some urgent issue   next Monday, I would finish the remaining work after I come back to Ottawa from Toronto.

       I appreciate if you have any suggestion about my assignment.

Thanks.
John