F02
Programming 1: Thinking in Steps
“Writing a recipe a robot follows *exactly*”
Lessons
Start the course →0 of 26 lessons done
- Your first recipe for a computerA program is a list of instructions the computer follows exactly, top to bottom. print() shows text on screen. · 10 min
- Values, types and arithmeticEvery value in Python has a type (whole number, decimal, text, true/false), and the type decides what you can do with it. · 12 min
- Variables: names for valuesA variable is a name tag stuck on a value so you can use it later. The = sign means "stick this name on that value", not "is equal to". · 12 min
- Talking to the userinput() asks the user a question and always gives back text. Convert it with int() or float(), and build answers with f-strings. · 12 min
- Making decisionsif, elif and else let a program choose what to do. Conditions are True/False questions built with comparisons and and/or/not. · 14 min
- Repeating with whileA while loop repeats a block of code as long as a condition stays True. Something inside the loop must eventually make it False. · 13 min
- for loops and rangeA for loop does something once for each item in a sequence. range() makes a sequence of numbers, and an accumulator builds up a result. · 14 min
- Meet Bit the robotControl a robot on a grid with a handful of commands. Sequences, loops and decisions turn a few simple commands into smart behavior. · 15 min
- Functions: your own instructionsdef creates a new instruction with a name. Parameters are its inputs, and return sends a result back to whoever called it. · 15 min
- Scope and the call stackEvery function call gets its own private workspace (a frame). Calls stack up like plates, and each one disappears when it returns. · 14 min
- Decomposition and abstractionBig problems become easy when you split them into small, named helper functions. Each helper hides its details behind a clear name. · 16 min
- Strings up closeA string is a sequence of characters you can index, slice, search and transform. Strings never change; methods give you new ones. · 16 min
- ListsA list holds many values in order, under one name. You can index it like a string, but unlike a string you can change it. · 15 min
- Mutability, aliasing and cloningTwo names can refer to the same list. Change it through one name and the other sees the change too. Copy the list when you want independence. · 15 min
- Tuples and list comprehensionsA tuple is a list that can't change, perfect for fixed groups like coordinates. A list comprehension builds a whole list in one readable line. · 14 min
- Grids and imagesA list of lists makes a grid. A digital image is exactly that, a grid of pixels, so with two nested loops you can write your own photo filters. · 18 min
- Dictionaries and setsA dictionary looks things up by a label (key) instead of a position. A set keeps only unique items and answers "is it in here?" instantly. · 16 min
- Reading and writing filesFiles let data outlive your program. Open a file, read it line by line or write to it, and Python closes it for you with a with block. · 15 min
- When things go wrongErrors are Python's way of saying "I can't do this." try/except lets your program catch an error and recover, and raise lets you signal your own. · 14 min
- Testing and debuggingTesting is trying your code on carefully chosen inputs to find bugs. Debugging is the detective work of finding why a bug happens, one experiment at a time. · 16 min
- Floats and approximationComputers store most decimals only approximately, so 0.1 + 0.2 isn't exactly 0.3. Instead of exact answers, good programs find answers that are close enough, fast. · 16 min
- Objects and classesA class is a blueprint for a new kind of value. Each object made from it bundles its own data (attributes) with the things it can do (methods). · 17 min
- InheritanceA subclass is a more specific version of a class. It inherits everything from its parent and can add or change behavior. · 15 min
- How fast is my code?Instead of timing code with a stopwatch, count how the number of steps grows as the input grows. That growth, written as Big-O, tells you whether code will still be fast with a million items. · 17 min
- Drawing and plottingA canvas is a grid of pixels with (0, 0) at the top-left. Shapes, loops and a little math turn numbers into pictures and data into charts. · 15 min
- Boss level: build a text adventurePut everything from this course together to build a playable game, with rooms in dictionaries, state in variables, commands parsed from strings, and functions keeping it organized. · 45 min
💼 Already know this course?
Placement tests are coming soon. Until then, you can mark it as known so it’s colored in on your map. You can undo this any time.