Python Advanced Interview Question