Python Program To Implement A Algorithm