A wind tunnel test rig runs the code shown, which is intended to count down from 8 to 1.
count = 8
while count > 0:
print(count)
why this code does not terminate.
A wind tunnel test rig runs the code shown, which is intended to count down from 8 to 1.
count = 8
while count > 0:
print(count)
why this code does not terminate.
A wetland bird survey reads counts from an observer until a count of -1 signals the end, then reports the mean. The function next_count() is provided elsewhere and returns the next count.
total = 0
seen = 0
value = next_count()
while value != -1:
total = total + value
seen = seen + 1
print(total / seen)
A cheese maturing store must report whether a wheel is ready.
A plant nursery uses the function shown, which is intended to return True when every label in a list has been printed.
def all_printed(labels):
for i in range(len(labels)):
if labels[i] == True:
return True
else:
return False
Practice IB Computer Science (First Exam 2027) Topic B2.3 Programming Constructs with authentic exam-style questions for both SL and HL students. This question bank focuses on the exact syllabus content for B2.3 Programming Constructs and mirrors Paper 1, 2 style where relevant.
Get instant solutions, detailed explanations, and build confidence with questions aligned to IB examiner expectations.