Creating your first investment Goal using Python
Let’s pick things up from where we left off in the previous chapter. Open up Google Colab in your browser of choice, and either continue in your existing Colab notebook or create a new one for this chapter.
If you don’t have much experience with programming languages, then a key concept you will need to learn about is classes. To make it simple, a class is a place to store information that you want to reuse in your code. This helps avoid having to write the same code over and over again, which is a common source of errors. Goals are something we plan to reuse across our code, and therefore it’s useful to define some details about Goals to make our life easier later on. This prevents us from having to copy and paste sections of code including lists of variables and will help us maintain code that can be easily updated when changes are needed.
In our situation, the first useful class will be Goal
. This is because...