Heads up! To view this whole video, sign in with your Treehouse account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice Emulating Built-ins!
You have completed Practice Emulating Built-ins!
Preview
Walkthrough a solution to the challenge.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
First, we needed to add a dunder string
method to Dog that returns the Pet's name.
0:00
So, if I scroll down here a bit,
0:03
you can see I added it right
under the init method.
0:06
Dunder string, take self, and
0:10
I'm just returning a f string that I just
decided to do Pet name with a colon.
0:12
And then put in {self.name} to access
our name instance attribute and
0:17
have that printed to the screen.
0:21
Next was to add a dunder equals
method to Dog that checks if
0:25
two dog's names are the same.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up