Amazon interview question

An Automation exercise in python