Reading material from teachers and learners: theory, worked examples and questions that make you think. Some notes are made with AI, and they always say so.
A brief note on The Periodic Table as Data: the elements as a pandas table, selecting, sorting and filtering, computed columns, plots of the trends coloured by block, and groupby, corr and diff to find patterns and breaks. With a worked example, practice, a program and questions to check yourself.
A brief note on Moles and Reactions by Computer: reading formulas into counts with a dictionary and re, molar mass and percent composition, the limiting reagent as a function, yield and gas volumes, and solutions in code. With a worked example, practice, a program and questions to check yourself.
A brief note on Simulation and Data with pandas: seeded random numbers, Monte Carlo and its error, random walks and decay, the standard error, and pandas tables: selecting, cleaning, grouping and plotting. With a worked example, practice, a program and questions to check yourself.
A brief note on Solving Equations and Calculus by Computer: bisection, Newton's method and brentq, polynomials and fits, systems of equations, slopes and areas from numbers, quad, and Euler's method with solve_ivp. With a worked example, practice, a program and questions to check yourself.
A brief note on NumPy Arrays and Graphs: making arrays, maths on whole arrays, slices and masks, summaries along an axis, line and scatter graphs, bars and histograms, subplots, and speeds from data with np.diff. With a worked example, practice, a program and questions to check yourself.
A brief note on Data Structures, Testing and Debugging: stacks, queues, linked lists, search trees, graphs with BFS and DFS, tables of tests, unittest, edge cases, and the steps to find a bug. With a worked example, practice, a program and questions to check yourself.
A brief note on Files, Comprehensions and Generators: text files and their modes, lines as records, CSV and JSON, list, set and dictionary comprehensions, zip and enumerate, iterators, generators and pipelines. With a worked example, practice, a program and questions to check yourself.
A brief note on Classes and Inheritance: objects and classes, __init__ and self, state and its rules, class and object attributes, inheritance with super(), overriding, special methods, and is a or has a. With a worked example, practice, a program and questions to check yourself.
A brief note on Working with Text and Real Projects: split(), join() and strip(), cleaning and counting words, letter codes and f-strings, looking inside text, and a method for building your own projects. With a worked example, practice, a program and questions to check yourself.
A brief note on Searching, Sorting and Recursion: linear and binary search, sorted() and sort() with a key function, counting the work, and recursion with a base case and the call stack. With a worked example, practice, a program and questions to check yourself.
A brief note on Errors and Modules: the six errors to know and how to read a traceback, try and except, asking again, raising your own errors, and the math, random, statistics and datetime modules. With a worked example, practice, a program and questions to check yourself.
A brief note on Dictionaries, Tuples and Sets: looking up and changing pairs, counting and grouping with a dictionary, fixed tuples and unpacking, sets and their operations, and choosing a container. With a worked example, practice, a program and questions to check yourself.
A brief note on Lists and Functions: making, reading and changing lists, lists with loops, copies and tables, functions with parameters and return, testing a function, and fixing your own programs. With a worked example, practice, a program and questions to check yourself.
A brief note on Loops: the for loop and range(), loops that build totals, counts and products, a loop inside a loop, the while loop, break and continue, and choosing the right loop. With a worked example, practice, a program and questions to check yourself.
A brief note on Making Decisions: the six comparisons, if, elif and else, the words and, or and not, ranges and in, decisions inside decisions, and testing every branch. With a worked example, practice, a program and questions to check yourself.
A brief note on Talking to the User: input() and changing text into numbers, positions and slices, string methods, f-strings, and running Python on your own computer. With a worked example, practice, a program and questions to check yourself.
A brief note on Getting Started with Python: print() and comments, reading an error message, variables and the four types, good names, and Python as a calculator with //, % and **. With a worked example, practice, a program and questions to check yourself.
An error message is a clue, not a punishment. This note shows how to read it from the bottom, what the common error names mean, and what to do when the program runs but gives the wrong answer.
Both loops repeat steps. A for loop is for a known number of repeats or a collection. A while loop is for repeating until something changes. This note shows how to choose, and how to avoid a loop that never ends.