4 Python codes for lab 3