Algorithms practice with Python