Variables, lists and debugging
Bugs are normal. Finding them quickly is a method, not a talent.
Part of your national curriculum
- Algorithms and programming: Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems
- Algorithms and programming: Use a variety of data structures, including lists, tables or arrays, and design modular programs that use procedures or functions
- Algorithms and programming: Understand simple algorithms, expressed using sequence, selection and iteration, and correct errors in algorithms
- Algorithms and programming: Design and develop modular programs that use procedures or functions, and test and correct them systematically
Lesson overview
What you'll learn in this lesson
Test and debug a program systematically
Key learning points
- • Storing data
- • Systematic testing
This lesson at a glance
- 30 minutes
- 13 parts to scroll through
- 3 quick checks
- Marked quiz at the end
- Gentle pace: short sittings with pauses
Words to know
Scroll down — the lesson carries on below
Watch & discover
Part 1 of 13
Visual introductionPicture this
Variables, lists and debugging
Bugs are normal. Finding them quickly is a method, not a talent.
In a nutshell
Test and debug a program systematically
Explore the idea
Part 2 of 13
Learn
Storing data
A variable holds one value; a list holds many, accessed by index. Meaningful names save more time than clever code.
Explore the idea
Part 3 of 13
Learn
Systematic testing
Test normal, boundary and invalid inputs. When something fails, change one thing at a time and print values to see what the program actually holds.
Reset break
Part 4 of 13
Pause
That's sitting 1 of 3 done
Stretch, get a drink, look out of the window. There is no timer and nothing is counting down — your place is saved, so you can come back in five minutes or tomorrow.
Quick check
Part 5 of 13
Quick check
Part 6 of 13
Quick check
Part 7 of 13
Reset break
Part 8 of 13
Pause
That's sitting 2 of 3 done
Stretch, get a drink, look out of the window. There is no timer and nothing is counting down — your place is saved, so you can come back in five minutes or tomorrow.
Challenge round
Part 9 of 13
Game · Sort it
Which of these are true?
Drag each card into the right column. Tap a card first if dragging is fiddly.
True
Not true
Challenge round
Part 10 of 13
Game · Fill the gaps
Finish the sentences
Choose the word that belongs in each gap.
When something fails, change one thing at a time and print values to see what the ____ actually holds.
Challenge round
Part 11 of 13
Game · Recall cards
A list stores…
Card 1 of 4
Mastery quiz
Part 12 of 13
Marked quiz
End of lesson quiz: Variables, lists and debugging
4 questions, marked with the reasoning shown. No timer.
1. A list stores…
2. A boundary test uses…
3. When debugging you should change…
4. Why use a list rather than 30 separate variables for 30 test scores?
Lesson round-up
Part 13 of 13
Lesson round-up
Ready when you are
Quiz score
Not sat
Games
Not played
Points this lesson
0
Best run
0 in a row
Luna: 0 out of 3 on the practice checks. Only if you feel up to it — one more?
Ask LunaPart 1 of 13 · Watch & discover
How this is going
- Not looked at yet
Use two or more programming languages, at least one of which is textual, to solve a variety of computational problems
- Not looked at yet
Use a variety of data structures, including lists, tables or arrays, and design modular programs that use procedures or functions
- Not looked at yet
Understand simple algorithms, expressed using sequence, selection and iteration, and correct errors in algorithms
- Not looked at yet
Design and develop modular programs that use procedures or functions, and test and correct them systematically
