- Read Tutorial
- Watch Guide Video
In this first section, we're going to discuss one of the key fundamentals when it comes to programming in any language; variables. If you are new coding, a variable may seem alien outside of statistics and mathematics. However, variables are a major portion of building programs.
For those unexposed to variables beforehand, let’s explore an example. Let’s say, I have a red solo cup with the name “Jordan_water”. Because of its easy reference, I could ask for someone to bring me the “Jordan_water” cup, and they would know exactly which container of water I was requesting.
With this cup, I could perform a multitude of tasks—drink from it, water plants with it, etc. The cup itself is simply a container for what I decide to put in it, not the water itself. The cup creates a simple transportation for its contents. It is convenient to reference because of its name that labels it for others to know what I am talking about.
In programming, variables themselves are simply containers for different data elements. You may put a set of numbers, a calculation, or even an entire sentence or paragraph within a variable. In this section, we will dive into what variables are, their syntax, and how to use them with the best practices.
Common variable naming practices that students are taught may include writing in all capital letters, adding underscores between words, or randomly placed capitals throughout.
In Python. there are standard practices when it comes to naming these variables. The goal for the end of this section will be not only for you to understand the correct syntax for using variables in Python, but also how to follow the best practices in the language. In extending our knowledge on variables, we must discuss what to place inside these variables.
In programming data types allow for the type of content in a variable—numbers, sentences, paragraphs, etc. One data type may enable you to use sentences, another will aid you to use numbers. Also in this section, we will walk through the key data types in Python to give you exposure to them, but each will be explained in greater detail in their own section.