Figure 1 is a short Python program. We number its eight lines only so they can be named in the questions.
Choose the line in Figure 1 where a calculation with an arithmetic operator happens first.
Our own questions on this topic, marked straight away, so you see what to revise. Free now.
Show model answer for 01.1Hide model answer for 01.1
Line 6. It is the first line that adds two values together.
How the marks are earned
- Line 6, where a value is added to itself.
- Choosing more than one option earns nothing.
Choose the one statement about Figure 1 that is untrue.
See how you would score on OperatorsShow model answer for 01.2Hide model answer for 01.2
The false statement is that the program uses concatenation, which means joining strings together. Every + in the program adds numbers, so nothing is joined as text. The comment on line 1, the assignments and the while loop are all really there.
How the marks are earned
- The statement 'It uses concatenation' is the false one.
- Choosing more than one option earns nothing.
Name the relational operator that Figure 1 contains. The symbol or its name is fine.
See how you would score on OperatorsShow model answer for 01.3Hide model answer for 01.3
< (less than). The loop condition b < c compares two values, so < is the relational operator.
How the marks are earned
- < or the words less than.
- Writing the assignment symbol = earns nothing.
Fill in a trace table with columns a, b, c and Output for the whole of Figure 1.
See how you would score on Trace TablesShow model answer for 01.4Hide model answer for 01.4
a b c Output
1 1 5
2 2 2
4 3 4
8 4 8
16 5 16How the marks are earned
- First row of the table: a is 1, b is 1 and c is 5.
- The first output is 2.
- Column a continues 2, 4, 8, 16 below its first value and Output has 4, 8, 16 below its first value; neither column holds anything extra.
- The rest of column b is 2, 3, 4, 5, with no extra values.
- Different rows may be used if the order within each column is clear.
- A value written again on the next row of the same column does not count against the answer.
- If the table has any error, the maximum is 3 marks.
Why it scores
The starting values 1, 1 and 5 fill the first row. Each pass of the loop doubles a, adds 1 to b and prints the new a, giving 2, 4, 8 and 16. When b reaches 5 the test b < c fails, so the loop stops with nothing more printed.
Revise Trace Tables