Skip to main content

Python: Loops, Lists and Functions Class 8 Computer Science lesson

Write Python programs with for and while loops, store data in lists, and organise code into functions with parameters and return values.

In short: Python is a text-based programming language. Indentation (spaces at the start of a line) shows which lines belong inside a loop, an if or a function.

9 partsUpdated 🔒 Preview
Scroll to begin ↓
Turn this on and each part is read out as you reach it.

What this lesson covers

About this lesson

Python: Loops, Lists and Functions is a 9-part Class 8 Computer Science lesson. Each part makes one point and then hands over to the next, so it can be read in a sitting or picked up again at the part you stopped on. It defines the idea in plain words before using it, works through an example step by step, breaks the topic into its parts and compares them, shows where it is used outside the textbook, names the mistakes that cost marks in an exam, ends with a recap of what to remember.

How it begins

Python is a text-based programming language. Indentation (spaces at the start of a line) shows which lines belong inside a loop, an if or a function. A for loop repeats a set number of times: for i in range(5): runs with i = 0, 1, 2, 3, 4.

The 9 parts

  1. 1Python building blocks
  2. 2Lists
  3. 3Loops over lists
  4. 4A function with a return value
  5. 5Why use functions?
  6. 6Watch out: off by one
  7. 7Trace a Python loop over a list
  8. 8for or while?
  9. 9Pythonista!
📝Free notes and MCQs with answersThe key ideas of Python: Loops, Lists and Functions, open to read without an account.Open the notes →
🔒

This topic needs a subscription

This lesson is part of a paid plan. Create a free account to start with our free lessons, or subscribe to open every topic.

9 parts in this lesson
  • 🆓 Free lessons are open on any account
  • 📗 Monthly: 5 paid topics a month
  • 📘 Yearly: 7 paid topics a month
  • ⭐ Premium, every topic, unlimited
  • 🧺 Or buy this single topic, the lesson is included

Practise Python: Loops, Lists and Functions

Everything on QuizByt for Class 8 Computer Science that goes with this lesson: read it first, then test yourself while it is fresh.

🧠 3 quizzes on Python: Loops, Lists and Functions (1 easy, 1 medium, 1 hard)

Work up from easy to hard: the hard quiz asks the Class 8 exam-style questions on Python: Loops, Lists and Functions.

🖨️ Printable worksheet

Python: Loops, Lists and Functions on paper for Class 8, with room to write the working out. Preview the first page free.

🎮 Games for Class 8 Computer Science

Memory and reasoning games at the right level for Class 8. Passing a quiz on Python: Loops, Lists and Functions earns the credits that open them.