Python code implementation for Coursera Course Principles of Computing