finish q1 and q2 using python