common algorithms in python