Neco 2020 Computer Studies Question 25
Practice objective / multiple choice question 25 from the 2020 Neco Computer Studies examination.
The following Python function counts how many unordered pairs of numbers in a list have a sum divisible by 5: ```python def count_pairs(lst): count = 0 n = len(lst) for i in range(n): for j in range(i+1, n): if (lst[i] + lst[j]) % 5 == 0: count += 1 return count numbers = [12, 7, 3, 14, 8, 5] result = count_pairs(numbers) print(result) ``` What integer does the program print?
Answer Options
About This Question
This is Neco 2020 Computer Studies Question 25. It is one of the objective questions from the 2020 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.