Python homework3