The point of these exercises is to point out that it's too simplistic to simply say that programming lanuage X is better or faster than programming language Y.
Last time I had such discussions was as teenager.😉
Typically you use and combine various programming languages, e.g. #python (for high-level code) with #cpp (for performance critical low-level code). Textbook sample: #numpy. Or #tensorflow.