Library
Explanations you can run, every error you will meet, and practice without a lesson around it.
/
When it breaks
All 24 errorsYour code stopped with a red message. Find the first word of its last line.
NameErrorA line uses a name Python has never been given.TypeErrorAn operation got the wrong kind of value.IndexErrorA list or string was asked for a position it does not have.ReferenceErrorA line uses a name that does not exist where it runs.Cannot read properties of undefinedA property was read from undefined or null.is not a functionSomething that is not a function was called with brackets.no such columnThe table has no column with that name.no such tableThe database has no table with that name.syntax errorThe query breaks SQL grammar at or just before the word it names.undeclaredA line uses a name the compiler has not seen yet.';' expectedThe compiler wanted a symbol, often missing on the line above.memory access out of boundsThe program touched memory past an array or through a bad pointer.
See how it works
All 28 conceptsStep through what the computer does, one line at a time.
- Arrays in memoryA C array is a row of same-sized values packed side by side in memory. Indexes start at 0, and nothing stops you walking off the end.
- Pointers and addressesEvery variable lives at an address. A pointer is a variable that holds one, and * follows it to the value that lives there.
- The stack and the heapLocal variables live on the stack and vanish when their function returns. malloc gives you heap memory that stays until you free it.Premium
- DictionariesA dictionary maps keys to values, like item names to counts or usernames to scores. Look up, add, update and loop over pairs.Premium
- Functions and return valuesA function is a named block you can run with different inputs. Parameters carry values in, return carries one value back out.Premium
- Lists and positionsA Python list keeps values in order. Read items by position, count from the end with negative indexes, take slices and change the list in place.
- Loops that build a resultA for loop runs the same lines once for each item. Pair it with a total or a new list that grows on every pass to turn many values into one answer.
- Names and valuesA Python variable is a name that points at a value. Two names can point at the same value, and that matters once the value can change.
- JOIN: two tables into one resultA JOIN pairs rows from two tables wherever a column matches. INNER keeps only the pairs; LEFT keeps every row of the first table.
Practise on your own
All 24 challengesA goal and some tests. No starter solution, no highlighted line.
- Longest win streakWarm-upDone
- Count the hashtagsWarm-upDone
- Find the busiest hour at the tuck shopWarm-upDone
- A health bar that stays in rangeWarm-upDone
- A chat filterCoreDone
- Merge two game inventoriesCoreDonePremium
- A leaderboard of best scoresCoreDonePremium
- Basket total with discount codesCoreDonePremium
On one page
Glossary, 78 terms12 bigger examples to run, pull apart and open in the playground.