Amadeus interview question

about python coding