python codes written for the labs