Question: I have been trying to learn programming with python 3 for a couple of months now and I have gotten stuck on classes. Specifically private and public methods.

What I don't understand is what private methods are for. I understand that public methods can be directly accessed by the user / program. But I fail to understand private methods, what they are for and why they exist.

I did a good bit of research on Stackoverflow but didn't find anything to answer my question. So if this is a duplicate I apologize in advance.

Answer: 
When you create objects, you are creating an API. You are giving that object attributes and methods that the outside world can interact with. `car.drive()`, `horse.color`, etc. 

In the real world, the implementation of a class requires that you create a lot of methods specifically to make the class work, and are not part of this exposed API. Maybe you need a method called "honk", but you don't want it to be used anywhere except within your own code. 

It is these internal methods that we consider to be "private". Some programming languages have formal constructs for making public or private methods. Python does not. However, by convention, methods and attributes that begin with an underscore are to be treated as private.

Just about every experienced python programmer, when seeing a method with an underscore, knows not to call it from anywhere outside of the class definition. They *can*, but they normally don't.

Why would you want some things to be private? One reason is that code changes. You add parameters, you remove parameters, you change algorithms. The public interface is something that doesn't normally change much once it's created. You may add to it, but you don't usually make big changes.

Private methods, by nature of being "hands off" to the outside world, can be freely changed without worrying about what other parts of the code may be calling those functions.
Private methods are intended for use by only your own class and not to be called anywhere else. The purpose it serves is [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)).