Accenture interview question

Question on python and coding