Algorthms(4th edition) by Robert Sedgewick and Kevin Wayne exercises in python, all the codes can be run with doctest, and the Python Version is 3.4, Python 2.7 might be compatible. Those non-programming exercises will be excluded, and some exercises need to take more time to figure it out.
More python algorithms can be found in here