Solution script for exercise 4

Click Exercise-4.ipynb link to view the file.