TEKsystems interview question

Some programs to solve in python