Subjects · Leaving Cert Computer Science
Leaving Cert Computer Science: Loops & trace tables
How often Loops & trace tables comes up on the Computer Science papers, every year it was asked, and questions to try.
HL Asked on 5 of the last 5 Higher Level papers, most recently in 2025. banker
OL Asked on 4 of the last 5 Ordinary Level papers, most recently in 2025. most years
Quick ones on Loops & trace tables.
- 4
- 5
- 6
- 11
- 10
- 8
- 10, 7, 4
- 10, 7
- 10, 7, 4, 1
Show the answers
(a) 5
(b) 8
(c) 10, 7, 4
Higher Level
Asked on 5 of the last 5 Higher Level papers, most recently in 2025. banker
Every paper, year by year
| Year | Where it came up |
|---|---|
| 2025 | B14 |
| 2024 | A2, C16 |
| 2023 | A7, C16 |
| 2022 | B15, C16 |
| 2021 | A5 |
Links open the State Examinations Commission’s paper for that year.
More Loops & trace tables questions
Loops & trace tables, 2 marks
What usually causes an infinite while loop?
- The loop uses range()
- The loop body has no print
- The condition never becomes False
Show the answer
The condition never becomes False
A while loop stops only when its condition is False. If nothing in the body changes the tested variable, for example a missing count = count + 1, it runs forever.
Loops & trace tables, 2 marks
How many times does for i in range(3, 11): print(i) print?
- 7
- 8
- 9
Show the answer
8
range(3, 11) runs from 3 up to 10, because the stop value 11 is left out. That is 11 - 3 = 8 values.
Loops & trace tables, 3 marks
What does for i in range(0, 10, 4): print(i, end=' ') display?
- 0 4 8
- 4 8
- 0 4 8 12
Show the answer
0 4 8
Start at 0 and add 4 each time: 0, 4, 8. The next value, 12, is past the stop value 10, so the loop ends there.
Ordinary Level
Asked on 4 of the last 5 Ordinary Level papers, most recently in 2025. most years
Every paper, year by year
| Year | Where it came up |
|---|---|
| 2025 | C16 |
| 2024 | B13 |
| 2023 | B13, C16 |
| 2022 | Not asked |
| 2021 | A9, C16 |
Links open the State Examinations Commission’s paper for that year.
More Loops & trace tables questions
Loops & trace tables, 2 marks
How many numbers does for i in range(5): print(i) print?
- 4
- 6
- 5
Show the answer
5
range(5) gives 0, 1, 2, 3, 4: five values. It starts at 0 and stops before 5.
Loops & trace tables, 3 marks
Last number printed by for i in range(2, 8): print(i)?
- 6
- 7
- 8
Show the answer
7
range(start, stop) stops BEFORE the stop value, so this gives 2, 3, 4, 5, 6, 7.
Loops & trace tables, 3 marks
Numbers printed by for i in range(1, 10, 3): print(i)?
- 1 4 7
- 1 4 7 10
- 3 6 9
Show the answer
1 4 7
Start at 1 and add 3 each time: 1, 4, 7. The next value, 10, is not less than 10, so the loop stops.
Other Computer Science topics
- Abstraction & pattern recognition
- Binary & hexadecimal
- CPU, memory & storage
- Embedded systems & sensors
- Ethics & social impact
- Flowcharts & pseudocode
- Internet, WWW & protocols
- Problem solving & puzzles
- Selection & Boolean logic
- Universal design & accessibility
- Variables, data types & operators
- Algorithmic complexity
- Data analytics & data quality
- Functions & modules
- 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