All the coding done in Python