Implementations of simple algorithms in Python