Interpreter and Compiler

Python => interpreter & other languages like CPP => compiler-based languages. I didn't know the way I could see the difference.

Here is the program that helped me to understand :

// C++ Code
#include <iostream>
int main() {
    // Write C++ code here
    std::cout << "Hello world!";
    cout=123
    return 0;
}
//It will  throw an error when cout will be initialised to 123.        
len("abcd")
len=2
# It will not throw an error.         

While we use Python most of the places, this information will be helpful to know why placing some lines of code somewhere may not throw an error even if it is incorrect.

So in brief, even when the program executes successfully in Python it may contain errors, only thing is they are yet to be disclosed !!!

要查看或添加评论,请登录

社区洞察

其他会员也浏览了