IBM Interview Question

Solve the following Python question?