Good way to learn encapsulation with Python?

3 points by codetricity ↗ HN
I'm teaching a 12 year old girl Python and want a tutorial to show best practices for separation of concerns, encapsulation , use of functions and classes. Most articles I've seen deal with theoretical recommendations. I want a step-by-step tutorial that is almost all code snippets and not very much text other than the code snippets. I'm looking for things like, put libraries in /lib, when to use from libname import function, when to create a class verses function. As this is for a 12 year old girl, I don't want a long essay on object oriented design, just a set of examples on what's a good way to do things. any help finding these types of tutorials for Python would be great. She's using Pygame

2 comments

[ 3.0 ms ] story [ 12.8 ms ] thread
I searched for "python encapsulation" and got this if you are interested: https://pythonspot.com/en/encapsulation/
Thanks man. I'm going to try and incorporate some of this for my 12 year old daughter. If there's a simpler explanation of this for kids, that would help. Otherwise, I'll power through and make something myself. BTW, if you have a daughter that you're teaching to program, I wrote some articles here: http://pychildren.blogspot.com/2015/01/tiled-map-creation-fo... I'm working on some new lessons. Peace.