problem #3. Python only.