The Apollo Guidance Computer for the Apollo programme which eventually landed the first person on the moon made use of core rope memory. The program code and fixed data (such as important physical and astronomical constant) were literally woven into a grid of magnetic round cores using a needle, with the sequence the wire took through the cores deciding the pattern of 0s and 1s. This highly technical work was done in bulk in factories by almost exclusively female workers.
Programming languages have different philosophies. They are often referred as being “strong” or “weak” and “static” or “dynamic”.
Strongly but dynamically-typed languages (e.g. Python)
Statically-typed languages (C++, Rust, SQL)
Weakly-typed languages (e.g. Javascript)
Like most programming languages, python has a bool
datatype. In some ways, this is the simplest type available. A Boolean can only be True
or False
, and is returned when evaluating an expression. For example:
our_result = 10>9
print(our_result)
Returns True
- we’re asking Python for the result of the comparison 10>9
, and to store this result in a variable called our_result
. The data type of a true-false comparison result like that is bool
, so our variable will also be of this type.
Booleans will become highly relevant when we talk about conditionals and program flow.
Numeric types are for variables that will only contain numbers. Other programming languages often have many different numeric types, but Python (mercifully) only has two:
int
can contain any5 whole (no fraction or decimals) number; negative, positive or zero. E.g.
a = -4
b = 3
c = 9087358292578
float
can contain any number with a decimal point, to arbitrary6 precision. E,g,
x = -2.2
y = 3.0
z = 2452.259259999999999
If you’re manually assigning a number to a variable, python will always choose an int
or float
depending on whether you’ve used a decimal point or not - so 2
and 2.0
are not equivalent in this context.
With data structures, we can address an element or elements by using square bracket notation - more on this below.
Strings (str
)
These are similar to a VARCHAR
in SQL. They are ordered sequences (strings) of characters7. Enclosed by quotation marks8. E.g.
our_string = "Hello world"
Lists (list
)
An ordered sequence of objects, where each object can be another data type (int, float, string, bool, etc). Enclosed by square brackets, and the items separated by commas. E.g.
our_list = [1, 2.3, "abc"]
Dictionaries (dict
)
Dictionaries are key-value pairs, where each entry is a pair of entries. Enclosed by curly braces, the keys and values separated by a colon and each pair separated by a comma. E.g.
our_dict = {"org_code":"0DF","name":"SCW CSU","year": 2013}
Built-in
tuple
s, the latter being like a dict
but non-changeable.Other packages
numpy
package.pandas
also offers additional data types such as timestamp
(similar to SQL’s datetime
).dataframes
(from pandas
) are an example of a higher-order class that makes use of datatypes within it; remember from previous sessions that a dataframe
can contain strings, integers, timestamps etc.Don’t worry about memorising any of this! If you take one thing away from this session, make it the fact that data types exist, that being aware of them will help you understand problems with your code, and that resources and documentation are readily available online.
experimental ternary computers and quantum computing are firmly out of scope of this presentation
from https://www.righto.com/2019/07/software-woven-into-wire-core-rope-and.html
from https://www.righto.com/2019/07/software-woven-into-wire-core-rope-and.html
from https://www.righto.com/2019/07/software-woven-into-wire-core-rope-and.html
there is no clearly-defined maximum number for an integer in python; certainly not one you’re likely to ever encounter
again, limits exist but aren’t relevant here
letters, numbers, symbols, etc. - any valid UTF-8 symbols
in most instances either double quotes ("
) or single quotes ('
) are fine - but it’s a good idea to pick one style and be consistent.
SAT // Intro to Data Types // July 2025