Some reusable python codes, and some solutions to challenges