Skip to content

Course home

Constructs

Constructs

EasyMedium
1234567891011121314
Question 8

A programmer is writing a script to sum card values until the user decides to stop.

01 score = 0
02 active = True
03 while active == True:
04     user_input = input("Enter card value: ")
05     if user_input == "exit":
06         active = False
07     else:
08         score = score + int(user_input)
09 print("Final score:", score)

Identify the line number showing repetition.

[1]
Markscheme

Constructs Questions

  1. IGCSE
  2. /Computer Science
  3. /Constructs

18 exam-style questions on Edexcel IGCSE Computer Science Constructs. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank