Neco 2021 Computer Studies Question 27

Practice objective / multiple choice question 27 from the 2021 Neco Computer Studies examination.

Neco 2021 Computer Studies Objective / Multiple Choice Hard Difficulty
Question 27 NECO • 2021 • COMPUTER_STUDIES • objective

Consider the following Python function:\n\n```python\ndef seq(n):\n a = 1\n b = 2\n total = 0\n for i in range(1, n+1):\n if i % 3 == 0:\n a = 1\n if i % 2 == 0:\n a = a + b\n else:\n b = a + b\n total += a + b\n return total\n```\n\nWhat value is printed when the function is called with `seq(5)`?

Answer Options

A. 38
B. 40
C. 45
Correct Answer D. 39
Correct Answer
D
Correct Option:
39

About This Question

This is Neco 2021 Computer Studies Question 27. It is one of the objective questions from the 2021 Neco Computer Studies examination.

Difficulty level: Hard .

Master the Exam!

You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.

Unlock Full Access Available for Android & Windows
Chat with Support