Anheuser-Busch InBev Interview Question

Coding interview in python. Explain the code you have done