Python Fundamentals
Learn to program in Python from zero: values, decisions, loops, functions, data structures, files, modules and a small data project.
Leads to: Data Analyst, Data Scientist, Machine Learning Engineer, Software Developer, Cybersecurity Engineer, Cloud Engineer, Mobile Developer, Back-End Developer, DevOps / Site Reliability Engineer, QA / Test Engineer, Data Engineer, Civil Engineer, Mechanical Engineer, Electrical Engineer, Biochemist, Biological Technician, Chemist, Physicist, Materials Scientist, Statistician, Actuary, Operations Research Analyst, Computer Science Teacher
Before you start
This course builds on Digital Literacy for Tech & STEM Work. Take it first if you are new to the topic.
About this course
A beginner course for anyone who wants to write real Python, whether you are heading into software, data, engineering or the lab sciences. You will run code in the browser with nothing to install, then work through variables and strings, conditions, loops, functions, reading tracebacks, lists, dictionaries, comprehensions, files, the standard library and a first class. The course ends with a mini project that parses a sensor log and reports summary statistics, plus how to plan a small program and share it on GitHub with a README. Every lesson has a reading, free videos, a quiz and a hands-on exercise checked automatically. The only prerequisite is basic computer confidence (Digital Literacy).
Course content
Module 1
Getting Started
3 lessons · 1h 40mRun your first Python code, store values in variables, format text and numbers, and make decisions with if, elif and else.
- 19mRunning PythonReading
Run your first Python program, print output and use Python as a calculator.
- 44mVariables, numbers, and stringsReading
Store values in variables, convert between numbers and text, and format output with f-strings.
- 37mConditions and booleansReading
Compare values, combine conditions with and, or and not, and branch with if, elif and else.
Module 2
Loops and Functions
3 lessons · 1h 43mRepeat work with for and while loops, package logic into reusable functions, and fix broken scripts by reading tracebacks.
- 31mfor and while loopsReading
Repeat work over ranges and lists with for loops, and loop until a condition changes with while.
- 42mWriting functionsReading
Define reusable functions with parameters, default values and return values.
- 30mReading errors and debuggingReading
Read a Python traceback from the bottom up, recognise common error types and fix bugs methodically.
Module 3
Data Structures
3 lessons · 1h 32mStore ordered data in lists and tuples, look values up by key with dictionaries and sets, and build new collections with comprehensions.
- 27mLists and tuplesReading
Store ordered data in lists, index and slice it, sort it, and use tuples for fixed groups of values.
- 30mDictionaries and setsReading
Look up and count values by key with dictionaries, and remove duplicates with sets.
- 35mComprehensionsReading
Build lists, dictionaries and sets in one readable line, with optional filtering.
Module 4
Files, Modules, and Packages
3 lessons · 2h 24mRead and write text and CSV files, use the standard library (math, statistics, datetime), and organise code with a first class.
- 1hReading and writing filesReading
Open text files safely with `with`, read CSV data with the csv module and write a summary file.
- 42mModules and the standard libraryReading
Import modules, use math, statistics and datetime from the standard library, and know when to reach for a package.
- 42mObjects and classes (intro)Reading
Define a small class with an __init__ method, attributes and methods that work on the object's own data.
Module 5
Mini Project
3 lessons · 2h 34mCombine everything into a sensor-log analyser, learn to plan a small program before coding it, and share it on GitHub with a README.
- 48mBuild a grade or sensor-log analyserReading
Parse messy text records, skip bad lines, group by key and report summary statistics.
- 57mPlanning a small programReading
Turn a vague idea into inputs, outputs, functions, pseudocode and test cases before writing code.
- 49mSharing your codeReading
Publish a script on GitHub with a clear README so others can understand, run and reuse it.
Where this course leads
Next course on the path
Careers that use it
- Data Analyst
- Data Scientist
- Machine Learning Engineer
- Software Developer
- Cybersecurity Engineer
- Cloud Engineer
- Mobile Developer
- Back-End Developer
- DevOps / Site Reliability Engineer
- QA / Test Engineer
- Data Engineer
- Civil Engineer
- Mechanical Engineer
- Electrical Engineer
- Biochemist
- Biological Technician
- Chemist
- Physicist
- Materials Scientist
- Statistician
- Actuary
- Operations Research Analyst
- Computer Science Teacher