BNP Paribas interview question

There was an extensive python challange during the test