Skip to main content


Welcome to the An Horse Teaches Python Textbook 🎉

A practical introduction to programming using the Python programming language.

Code Windows

Throughout the textbook, there will be several runnable and editable code examples. Click on the code windows to edit them and play around. Run and reset buttons will appear in the top right when hovering over the windows.

def foo():
    print('Go Ahead. Try editing this window!')

def bar():
    print('Click the run icon in the top right to run this code!')


We encourage you to try these out and play around with them. A great way to learn programming is to play around with code and to see what happens. But, be warned, your changes will be reset if you reload the page.


We are always looking to improve the site. If you want, let us know what you think of different chapters in the feedback forms at the bottom of each page (or if you spot any typos 🙂).