Interpreter:
An interpreter is used to translate a program line for line. It is more useful to use an interpreter when the programmer is making up the program and/or improvises. An interpreter and compiler contrast each other because of their different efficacy while they run the translation for the program.
A compiler is used to translate an entire program, which is often more useful for a long one. Instead of having to wait for a large program to translate after each line that is typed, it translates it all at the end and checks for any mistakes in the coding.