Trace tables and errors: AQA GCSE practice
Follow code and find the bugs. 15 questions in the style of the AQA GCSE exam.
Sample questions
What is a trace table used for?
- To store data permanently
- To record the values of variables as an algorithm is followed step by step
- To translate Python into machine code
- To draw the user interface
The program below should read whole numbers until 0 is entered and then print the mean of those numbers, rounded to 1 decimal place. It contains a logic error. Write a corrected version. You can assume at least one number is entered before the 0.
Explain the difference between a syntax error and a logic error. Give an example of each.