Python Solution for CE/SE Intern Challenge