Amount interview question

A quite easy python coding question. not leetcode style