Accenture interview question

Live Coding exercise on Python