convert Week1_Lecture1 matlab codes into python codes