Adding Lecture 21 in C++ and python