python and algorithms