Amdocs interview question

Based on Python and opps