Subjects · Leaving Cert Computer Science
Leaving Cert Computer Science: Functions & modules
How often Functions & modules comes up on the Computer Science papers, every year it was asked, and questions to try.
HL Asked on 4 of the last 5 Higher Level papers, most recently in 2025. most years
Quick ones on Functions & modules.
- 10
- 9
- 8
- def
- return
- A local variable
- A constant
- A global variable
Show the answers
(a) 9
(b) return
(c) A local variable
Higher Level
Asked on 4 of the last 5 Higher Level papers, most recently in 2025. most years
Every paper, year by year
| Year | Where it came up |
|---|---|
| 2025 | C16 |
| 2024 | Not asked |
| 2023 | C16 |
| 2022 | A1 |
| 2021 | C16 |
Links open the State Examinations Commission’s paper for that year.
More Functions & modules questions
Functions & modules, 2 marks
After from random import choice, what can choice(['R', 'G', 'B']) return?
- All three items
- Only R
- Any one of R, G or B
Show the answer
Any one of R, G or B
choice() picks one item from the list at random, so each run may give a different one. It never returns more than one item.
Functions & modules, 3 marks
def sq(n): return n * n. What does print(sq(sq(2))) display?
- 4
- 16
- 8
Show the answer
16
The inner call runs first: sq(2) = 4. Then sq(4) = 16. The value one function returns can be passed straight into another.
Functions & modules, 3 marks
def add1(x): x = x + 1, then return x. After n = 5, then add1(n), what is n?
- 5
- 6
- None
Show the answer
5
The function changes its own local x, not n. The 6 it returns is thrown away because it is not stored anywhere, so n stays 5.
Other Computer Science topics
- Abstraction & pattern recognition
- Binary & hexadecimal
- CPU, memory & storage
- Embedded systems & sensors
- Ethics & social impact
- Flowcharts & pseudocode
- Internet, WWW & protocols
- Loops & trace tables
- Problem solving & puzzles
- Selection & Boolean logic
- Universal design & accessibility
- Variables, data types & operators
- Algorithmic complexity
- Data analytics & data quality
- Logic gates & truth tables
- Roles, teams & stakeholders
- Searching algorithms
- Testing & debugging
- AI & machine learning
- ASCII & Unicode
- Design process & SDLC
- History & emerging trends
- Lists
- Privacy & cybersecurity
- Basic electronics
- Databases
- Modelling & simulation
- Operating systems
- Quicksort
- Recursion
- Sorting algorithms
- Strings & string methods
- Heuristics
- Turing machines