AXA Interview Question

Write a python code .