Deloitte interview question

Python coding questions not too hard