Question d’entretien chez UBS

Blocks of code in python and the expected outcome