Controlling Conversion6:24 with Kenneth Love
Whether we like it or not, someone, somewhere, is going to turn an instance of our class into a string. Or an int. Let's make sure it happens like we want.
You can read more about the magic methods. There are a lot of them, though, so don't try and memorize them all. You'll find that, over time, you memorize the most useful ones. Here are the ones I recommend you start with:
__str__- Control how your instances turn into strings
__init__- Customize the initialization of your instances
You need to sign up for Treehouse in order to download course files.Sign up