Figure 1 shows a Python program.
Figure 1
word = input("Enter a word: ")
if len(word) > 3:
print(word)
else:
print("Short")
The program in Figure 1 needs to be modified so that it repeats six times using definite (count-controlled) iteration.
Select the option that does this correctly.
count = 0
while count < 6:
word = input("Enter a word: ")
if len(word) > 3:
print(word)
else:
print("Short")
count = count + 1
count = 1
while count <= 6:
word = input("Enter a word: ")
if len(word) > 3:
print(word)
else:
print("Short")
count = count + 1
for count in range(0, 6):
word = input("Enter a word: ")
if len(word) > 3:
print(word)
else:
print("Short")
for count in range(0, 7):
word = input("Enter a word: ")
if len(word) > 3:
print(word)
else:
print("Short")
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.