Skip to content

Videos

Python Basics

Pick a topic to watch.

15 video lessons

3:46 Lesson 1 Your first program A computer is not clever. It cannot guess what you meant. It does exactly what you tell it, and nothing else. You write a line of instructions. Python reads… 3:37 Lesson 2 Variables Suppose your program mentions the same city three times. You could type it again, and again, and again — and then the day comes when the city changes, and you… 3:07 Lesson 3 Numbers & operators You do not have to teach Python arithmetic — it already knows. Write plus, minus, times, and it answers nine, five and fourteen without being told what those… 2:57 Lesson 4 Getting input Every program so far has known everything in advance. Here the greeting works perfectly — for Sam. You wrote the name into the program, so Sam is the only… 3:01 Lesson 5 Working with strings A string is a row of characters, and each one sits in a numbered position called an index. Here is the surprise that trips up every beginner: counting starts… 3:32 Lesson 6 Making decisions Everything you have written so far does the same thing every time it runs. Real programs need to choose. So you ask a question with a true-or-false answer — is… 3:03 Lesson 7 Counting loops To print the numbers one to five you could write it five times. It works. Now print one to five hundred, and the idea collapses — nobody types five hundred… 3:00 Lesson 8 While loops A for loop is perfect when you know the count in advance: print one to five, five passes, done. But now think about asking someone a question until they type… 2:48 Lesson 9 Lists Five test scores, and so far you would give them a name each: score one, score two, and so on. It works until you need to add them up, and then you are writing… 2:52 Lesson 10 Functions You have written the same four lines twice: total starts at zero, loop, divide by the length. If a third list turns up you will copy it again — and the day you… 3:04 Lesson 11 Scope & arguments Think of your program as a room, and every function call as a smaller room inside it. A variable made inside the function belongs to that small room: it is… 2:36 Lesson 12 Dictionaries Store a book in a list and you have to remember which position holds what. Was slot one the number of pages, or the year? Six months later you will guess… 3:23 Lesson 13 Planning & pseudocode When a task gets hard, the temptation is to start typing and hope. The faster way is to write the steps down in ordinary sentences first. Read the number.… 3:01 Lesson 14 Errors & testing Errors come in three kinds, and telling them apart tells you where to look. A syntax error breaks Python's own rules — a missing bracket, a missing colon — so… 2:27 Lesson 15 Putting it all together This is the last lesson, and it builds one small tool out of everything so far. You start with one list of scores. You want to know the average, how many…

Log in or create account

IGCSE, A-Level & AP