I test a lot of inline code in the shell, and save as the whole thing with the date and a hint of the contents. There have been times when these files came in handy. I never close the shell without first saving it. You just never know.
During the Python course it is almost a must to have a shell of some sort open that you can test lines of code in. I do this all the time just to refresh syntax or see the outcome first hand.The barebones Python with IDLE from their site is as good a place to start as any.
Open the shell, click File > New File, then copy the code from the lesson and paste it in. Save it in a folder that matches the course name, within a folder of the module name and give the file the lesson name.
This way you can run a quick search of your cc folder and find any lesson you want. Wish I’d done this years ago. Hindsight is 20-20.