SL, Paper 2 · Theme B: computational thinking and problem-solving

B2 Programming fundamentals and data structures

Questions for SL. · The lesson

1 of 5
Question 11 mark
  • No calculator needed
  • IB Computer Science SL and HL
Spec and skills
  • Paper scope: Paper 2
  • Topic spec B2.1 to B2.3
  • Topic spec B2.5
  • Skill: cs-b2
  • Knowledge check
  • Computer science guide, first assessment 2027, Published February 2025

What does this program print?

Code
total = 0
for i in range(1, 5):
    if i % 2 == 0:
        total = total + i
print(total)

Independent preparation for IB Diploma Programme Computer Science. Not affiliated with or endorsed by the International Baccalaureate Organization.

Questions? support@unigenius.co.uk

Privacy · Terms