Week1 programming assignment rewritten on python