Python code updated.