why is python slower than c code example

Example 1: why is c faster than python

C/C++ is relatively fast as compared to Python because when you run 
the Python script, its interpreter will interpret the script 
line by line and generate output but in C, the compiler will first compile it 
and generate an output which is optimized with respect to the hardware and OS.

Example 2: why is c faster than python

C/C++ is relatively fast as compared to Python because when you run the Python script, 
its interpreter will interpret the script line by line and generate output but in C, 
the compiler will first compile it and generate an output which is optimized with respect to the hardware.

Tags:

Misc Example