Is there a way to delete created variables, functions, etc from the memory of the interpreter?

You can delete individual names with del: or you can remove them from the globals() object: This is just an example loop; it defensively only deletes names that do not start with an underscore, making a (not unreasoned) assumption that you only used names without an underscore at the start in your interpreter. You could use a hard-coded … Read more