Python homework