On this page
Language translators are on the Class 11 Computer Science syllabus: the CBSE 2026-27 curriculum for subject 083 lists "assembler, compiler, and interpreter" in Unit 1 and teaches programming in Python in Unit 2. Here we run one small program in C and in Python and watch where they differ, so the comparison list makes sense before you memorise it.
What is the difference between a compiler and an interpreter?
A compiler translates the whole program into machine code and saves it as a file, which you then run as many times as you like. The GCC manual says compilation "can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order."
An interpreter runs your source code directly. The Python glossary puts it this way: with an interpreted language, "source files can be run directly without explicitly creating an executable which is then run."
The same small program in C and Python
The program stores three marks, prints them, and prints the average. In C, the file avg.c holds these lines:
`#include <stdio.h>`
`int main(void) {`
`int marks[3] = {72, 85, 91};`
`printf("Marks: %d %d %d\n", marks[0], marks[1], marks[2]);`
`int total = marks[0] + marks[1] + marks[2];`
`printf("Average: %d\n", total / 3);`
`return 0; }`
In Python, the file avg.py needs four lines:
`marks = [72, 85, 91]`
`print("Marks:", marks)`
`total = sum(marks)`
`print("Average:", total / 3)`
What happens when you run each one?
For C you give two commands. First `gcc avg.c -o avg`: GCC preprocesses the file (pulling in stdio.h), compiles it to assembly, assembles that into machine code and links it with the C library that supplies printf. The `-o` option names the output file, per the GCC manual. You now have a new file, avg, and nothing has run yet. Then `./avg` asks the operating system to load that file and the processor runs it: it prints the marks and "Average: 82". The total is 248, and dividing two whole numbers in C drops the fraction.
For Python you give one command, `python3 avg.py`, and the output appears. No avg program file is left behind. Python's `/` keeps the fraction, so you see 82.66666666666667.
Where does each one catch your mistake?
Misspell print in the last line of each program, and run them again.
C: `prntf` on line 6. GCC reports the error and makes no program file, so not even the first printf runs. You see the mistake before anything happens.
Python: `prnt` on line 4. The program prints "Marks: [72, 85, 91]", then stops with a NameError when it reaches line 4. The earlier lines already ran.
Now try a different mistake in Python: delete the closing bracket on line 4. This time nothing prints at all, not even line 2. Your syllabus lists syntax, logical and run-time errors in Unit 2, and this shows two of them. A syntax error is caught before the program starts; a misspelt name is a run-time error, found only when Python reaches it. If you get stuck while testing this, our guide to debugging code as a beginner has a five-step routine.
Is Python compiled or interpreted?
Both, in a sense, and the official documentation says so. The Python glossary calls Python "an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler." CPython, the standard Python, first compiles your source into bytecode, "the internal representation of a Python program", which a virtual machine then runs. That is why the missing bracket stopped everything: the file could not be turned into bytecode, so no line ran. You can see the bytecode for yourself with the dis module.
The same glossary entry gives the trade-off: interpreted languages "typically have a shorter development/debug cycle than compiled ones, though their programs generally also run more slowly."
How do you write the answer in a CBSE exam?
For a short-answer question, give a one-line definition of each, then a few of these textbook points:
Translation: a compiler translates the whole program at once; an interpreter translates and runs it statement by statement.
Output: a compiler produces a separate executable file; an interpreter does not.
Errors: a compiler lists errors after translating the whole program; an interpreter stops at the error it reaches.
Speed: a compiled program usually runs faster once built; an interpreted one is quicker to test and change.
Examples: C and C++ are compiled; Python is interpreted.
If the question asks about Python itself, add the bytecode step from the section above. Then add the C and Python trace as your example; it shows you understood the points rather than memorised them. To revise translators next to number systems and Boolean logic, the Fermi Concept Library gives each computing concept its own lesson.
If you plan to learn C later, see how to learn C with small programs and tracing. In Class 12, the same habit of tracing helps with recursion and the call stack in Python.



