Skip to content

CS Professional · Artificial Intelligence, Data Analytics and Cyber Security - Laws and Practice · Computer Hardware and Software

A start-up's developer writes a program in Python, which is run by an interpreter. Compared with a compiled language such as C, which statement about the interpreter is correct?

An interpreter translates and executes source code statement by statement while the program runs. A compiler instead converts the entire program into machine code before execution starts, so the first option describes a compiler, not an interpreter.

  1. AIt translates the whole program into machine code before any execution begins
  2. BIt translates and executes the source code statement by statement during run timeCorrect
  3. CIt converts the program into assembly language only and cannot run it
  4. DIt is used only for writing operating systems

Explanation

An interpreter reads, translates and executes source code line by line at run time, so errors appear when the faulty statement is reached. A compiler translates the entire program first, which is the behaviour described in the first distractor.

Did you get it right without looking?

One question tells you little. A timed set on Computer Hardware and Software shows your real accuracy, how long you take and where you lose marks.

More Computer Hardware and Software questions