01/09/2026 Lecture 1
An environment is Python in a specific version and a range of compatible packages. It
is not advised to update an environment to a new version, as it can create
incompatibilities in previous projects. Instead, you should create a new environment
with the new version. Now all projects work without interfering with each other.
Variables and data types
(a)Primitive data types are basic data types that store a single value.
(1) Numeric
(2) Text
(3) Truth
(4) Nothing
(b)Composite data types are more complex data types that can store multiple
values or combine different types of data.
I Collections:
Standardised data structures of any other primitive or composite data type (including
other collections), with pre-defined functions that work on the data.
(1) Sequences:
Elements
are stored in
a
given
order
or
sequence.
Immutable
sequence
ops are
sequences
whose
elements
cannot be
changed
after
creation.
Mutable
sequence
Ops
are
sequences
whose
elements
can
be
changed,
added,
or
removed
after
creation.
(2) Sets:
Unordered,
unique
elements.
Immutable
set ops are
sets whose
elements
cannot
be
changed
after
creation.
Python’s
frozenset is
immutable.
Mutable set
Ops are sets
that can be
changed by
adding
or
removing
elements.
Python’s set
is mutable.
(3) Dictionarie
s:
Unordered
key-value
mappings.
Dictionary
Ops
II Classes and objects:
Custom data structures of any other primitive or composite data type (including other
objects), with custom functions that operate on the object. All collections are also
classes/objects. In Python, all primitives are also classes/objects.
(1) Classes
Custom data structures of any other primitive or composite data type (including
other objects), with custom functions that operate on the object. All collections are
also classes/objects. In Python, all primitives are also classes/objects.
(2) Objects
A class is a pattern. Its instantiations (”realisations”) are called objects or instances.
Functions
(a)Built-in functions
(b)Data creation & conversion functions