Python Interpreter

Programming languages were designed in such a way that humans can easily learn it.

But the computer can't understand that directly. It will understand only the object level code.

Compiler or Interpreter converts the source code into object level code.

Python uses the interpreter to translate the source code.




Difference between compiler and interpreter

Both compiler and interpreter converts the high-level source code into low-level object code. In other words, both compiler and interpreter converts the human-readable source code into machine understandable object code.

Key Compiler Interpreter
Working principle Compiler takes the entire program and translates it into machine level code. The interpreter takes one statement at a time and translate it into machine level code.
Debugging Since it takes the whole program the errors will be displayed after the entire program is verified. So debugging is comparatively hard. Errors are displayed for every instruction interpreted. Hence debugging is very easy.
Memory Requirement While converting the compiler will generate intermediate object code. So, the Memory requirement is high. Interpreter won't generate any intermediate level code.So, its memory efficient.
Time complexity Overall execution time is faster than the interpreter. Overall execution time is slow.
Example C compiler Python interpreter

Topics You Might Like