python code q3