Classification of programming languages and translators

EasyMedium
12345678910111213141516171819202122232425262728293031323334
Question 7
Easy

The Python program shown below contains a syntax error.

1  scores = [85, 92, 78, 100]
2  total = 0
3  for i in range(len(scores)):
4      total = total + scores[i]
5      if total > 200
6          print("Target reached")

Select the two statements that are correct about syntax errors.

  • A: A syntax error is a violation of the grammatical rules of the programming language.
  • B: An example of a syntax error is using an incorrect comparison operator, such as writing < instead of >.
  • C: A compiler or interpreter will usually detect syntax errors before or during translation.
  • D: A syntax error will only be discovered when the program is executed with specific boundary test data.
  • E: Syntax errors are typically harder to find than logic errors because they do not produce any error messages.
[2]

Classification of programming languages and translators Questions

  1. GCSE
  2. /Computer Science
  3. /Classification of programming languages and translators