Some Algorithms in Python