GSK interview question

Use python coding to solve a question