Apple interview question

Many that needs to be coded in python.