finished convert Week1_Lecture2 codes from matlab to python