Conclusion

This chapter built the first Python habit: run code and inspect what happens.

Python runs exact instructions, not intentions. A script gives you a saved file you can rerun. An interactive session gives you a scratch space for small questions. Output shows what happened. Errors show where Python got stuck.

The main loop is:

write -> run -> inspect -> edit -> rerun

That loop will reappear throughout the Foundation path. When a vector operation has the wrong result, when a NumPy array has the wrong shape, or when a model training loop behaves strangely, you will return to the same loop.

What Comes Next

The next chapter introduces names, values, and types. That is where Python code starts to hold information and transform it.

Before moving on, make sure you can:

  • run a tiny .py script
  • tell code apart from output
  • identify the useful part of a simple error
  • change one line and rerun the program

If those actions feel ordinary, you are ready for the next chapter.