A programmer has started to write a program, but it does not work correctly. The program should ask the user, "Do you want to begin the countdown?". The user then responds 'y' or 'n'. If the user types 'y', then the computer displays a countdown from 5 down to 1, followed by "Takeoff!".
Below is the buggy source code:
a = input()
if a == "y"
for timer in range(5, 0 -1):
print(timer)
print("Takeoff!"
Amend the code to:
a to a more meaningful namerange function's last parameter, set to -1Do not add any additional functionality.
51 exam-style questions on Edexcel GCSE Computer Science Develop code, covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.