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.

City Guilds Model Questions Vol1 2022 Information Technology Objective / Multiple Choice Hard Difficulty
Question 44 CITY_GUILDS_MODEL_QUESTIONS_VOL1 • 2022 • INFORMATION_TECHNOLOGY • objective

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

A. 35
B. 27
C. 33
Correct Answer D. 31
Correct Answer
D
Correct Option:
31

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.

Unlock Full Access Available for Android & Windows
Chat with Support