Neco 2024 Computer Studies Question 30
Practice objective / multiple choice question 30 from the 2024 Neco Computer Studies examination.
The following Python function returns the sum of all integers from 1 to \(n\) that are multiples of 3 or 5 but not both. What value does the function return when called with \(n = 20\)?\n\n```python\ndef special_sum(n):\n total = 0\n for i in range(1, n+1):\n if (i % 3 == 0) ^ (i % 5 == 0):\n total += i\n return total\n```\n
Answer Options
About This Question
This is Neco 2024 Computer Studies Question 30. It is one of the objective questions from the 2024 Neco Computer Studies examination.
Difficulty level: Medium .
Master the Exam!
You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.