Skip to main content
Beta
This lesson is in the beta phase, which means that it is ready for teaching by instructors outside of the original author team.
Key Points
- Assign values to variables using
=
- Generate lists using square brackets
[]
- Use indexes inside
[], starting at 0, to select
characters from strings and items from lists
- Use
for to loop through items in iterable objects
- Make conditional expressions using
==, !=,
>, <, >= and
<=
- Use
f'{}' to embed formatted variables inside
strings
- Avoid use of generative AI for this course
- JSON is a simple, easy to interpret format for unstructured
data
- Dictionaries are defined using
key:value
pairs
- Dictionaries can be nested, and mixed with lists
- Web API’s can be accessed using the
requests
library
-
try-except structures are useful for catching errors as
they occur
-
assert structures are useful for forcing errors early,
to avoid wasted effort
- conda virtual environments are useful for installing programs with
differing requirements
-
conda config --add channels <channel> adds a new
channel to your list of sources
-
conda search <package> will find all available
versions of a package in your list of sources
-
conda create -n <env> <package(s)> can be
used to create a virtual environment from a list of packages
-
conda install -n <env> <pacakge(s)>
installs packages in a pre-existing environment
-
conda activate <env> activates the named
environment, giving access to the software installed there
-
conda deactivate deactivates the current
environment
-
conda export --from-history > <file.yml>
creates a portable record of your current environment
-
conda env create --file <file.yml> <env>
creates a new environment from an environment file
- assert
- testing frameworks