City Guilds Model Questions Vol1 2022 Information Technology Question 44
Practice objective / multiple choice question 44 from the 2022 City Guilds Model Questions Vol1 Information Technology examination.
Consider the following Python‑like code: ``` def collatz_steps(n): steps = 0 while n != 1: if n % 2 == 0: n = n // 2 else: n = 3*n + 1 steps += 1 return steps def total_steps(arr): total = 0 for x in arr: total += collatz_steps(x) return total data = [3, 6, 7] output = total_steps(data) ``` What integer value is stored in `output` after the function call?
Answer Options
About This Question
This is City Guilds Model Questions Vol1 2022 Information Technology Question 44. It is one of the objective questions from the 2022 City Guilds Model Questions Vol1 Information Technology 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.