python based problem 3 of england programming course