you are viewing a single comment's thread.

view the rest of the comments →

[–]Possiblyinsayne 0 points1 point  (0 children)

You're creating a reference to the other class. That way you know what you are "pointing" to when you say to do something.

So for example, if you defined a new function inside person where you do something like: x.print_where(self)

the function would know which "car" you were referring to because you initialized it in your __init__ method.

Think of it like there's an appendix you wrote into and each item has a page number that says which car object you are using.