Simplest definition of a variable is a “named container” of data you’d like to refer to in your program. There are 2 main reasons you may want to do this.
- Data usually tends to be bigger than a few characters. Imagine calling books by their whole content (possibly 100s of pages) each time you refer to them instead of their names. Amazon would never take off. 🙂
- Usually you’ll want to refer to your data multiple times in a program. So it helps to have it in a convenient container and call it whenever we need to such as when we want to print it.