Give Simple Python Code For A Algorithm