A long program that repeats the same block of code in five different places is fragile: fix a bug in one copy and the other four still carry it. Subprograms solve this by giving a named, reusable block of code a single home, one that any part of the program can call on whenever it is needed.
In this lesson you will learn the difference between procedures and functions, how to pass data into a subprogram using parameters and get data back out using a return value, and how local and global scope decide which parts of a program can see which variables. Every example is written in Python, one of the languages you can use for the Paper 2 practical programming exam.
This topic is mapped out so you can see how the ideas connect.
Open the mind map in the app
Quick recall practice on the facts this topic is tested on.
Practise these cards in the app
Get the Green Bridge CBT app on your phone or computer for the complete IGCSE library: past papers, mark schemes, mind maps, flashcards and audio lessons.
Congratulations on completing the lesson on Subprograms. Now that youve explored the key concepts and ideas, its time to put your knowledge to the test. This section offers a variety of practice questions designed to reinforce your understanding and help you gauge your grasp of the material.
You will encounter a mix of question types, including multiple-choice questions, short answer questions, and essay questions. Each question is thoughtfully crafted to assess different aspects of your knowledge and critical thinking skills.
Use this evaluation section as an opportunity to reinforce your understanding of the topic and to identify any areas where you may need additional study. Don't be discouraged by any challenges you encounter; instead, view them as opportunities for growth and improvement.
Work through these questions in the app
Work through these questions in the app
Want to practice mock questions on Subprograms? Download the Green Bridge CBT app to access mock questions and full practice assessments for this topic.
Everything you need to excel in your exams