Math in Section 1: Variables
In math, we have the concept of variables, which are used to express unknown values while solving problems. In math, we consistently see variables represented with the letter "x", or other letters, such as "y" or "a". We can also see variables represented with symbols, such as alpha or beta. In Python, the logic is practically same. We have variables, just like in math, that are represented by a letter or text (such as "x") and have values set using an equals to sign.
x = 360
text = "hello!"
The difference between Python variables and mathematical variables largely stems from the fact that in math, using variables to represent text values is far more unlikely then it is in Python, where all data types (strings, integers, booleans, etc.) are represented using variables. Additionally, just like how the letters e and i have special values in algebra and are usually not used as variables, π and e are also used in special instances with the Python math module and represent specific values.
Variables also allow for one thing in math that is also seen in Python: variables change verbal expressions into algebraic expressions, that is, expressions that are composed of letters that stand for numbers. For example, in both Python and mathematics variables can express the verbal expression the sum of a number and 5 as:
x + 5 or 5 + x
The value of six times a number can be expressed as an algebraic expression as:
6x
In both mathematics and Python.