Amount interview question

Please review my python program