I have studied complexity of algorithms that how long an algorithm will take to execute completely, then why it is said that certain programming languages are faster than others such as C++ is faster than python.
closed as too broad by gnat, Ben Cottrell, Greg Burghardt, Robert Harvey♦ Apr 23 at 12:11
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
First of all, programming language can have an effect on the time complexity of algorithms. For example, many algorithms rely on mutating an element in an array in O(1) time. So any language that doesn't have mutable arrays (and it's not hard to imagine e.g. a dialect of Haskell that doesn't have them) will have worse time complexity for many algorithms.
But that's not the case here. While there are many differences between C++ and Python, their core capabilities are similar enough that for any algorithm you can write in one of them, you can also write it in the other one, with the same time complexity.
But time complexity is not the same thing as performance. If I know that the complexity of some algorithm is O(1), I still don't know how long executing an implementation of that algorithm for some input will actually take: it could be 1 nanosecond, 100 years, or anything in between. And because of the way the two languages are designed and implemented, a program in C++ will almost always have better performance than an equivalent program in Python. Which is why it's said that C++ is faster than Python.