coding algorithms in python language