I will be going through the Python Introduction today and next time. The topics are numbers, variables, strings, and lists.
Data is stored in memory and python supports several types of data. Data in python is stored inside a variable. Data can be entered either directly in the code, read from an input/output device, or be the result of some computation.
Data values are things which take up cells in memory. In python, all data values are "stored" in a variable, meaning that python finds some unused memory cells to put the data and then attaches a name to that location. Later, when python sees that variable name, it will lookup the data contents and substitute them for the variable. We think of a variable as a labeled box which can store a some data value.
Integers in python are arbitrarily sized, meaning when we store an integer in a variable box, the box is sized large enough to hold the integer (i.e. enough cells are allocated to the box).
Fractions/decimals in python are stored in Floating Point The main issue with using floating point is that every computation will be rounded off at some number of significant digits. Great care must be taken working with floating point numbers, for example the rounding errors from the computations within the Apollo spacecraft would have been enough for the spacecraft to miss the moon, so the engineers at NASA had to explicitly account for the rounding error from the floating point computations.
Text is stored using ASCII or Unicode. There are many other old formats for text storage but as a community we are gradually standardizing on Unicode. This is an ongoing process currently.
Lists are data values where the contents can be any data values. I won't go into the details of how lists are stored in memory cells, wikipedia has some information if you are interested.
x = input("Enter a number: ")
y = input("Enter another number: ")
z = x + y
print("The sum is", z)
Run the above code to make sure it works. Next, change the program so that it prints the difference between the two numbers that are entered.