Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Create the logic for the card class for our memory game.
Accomplished in this Video
- Created a Card class
- Gave it two instance attributes that are passed in - the word for the card and its location
- Added another instance attribute that is not passed in - matched
- Created 2 dunder methods
-
__eq__
= check if two cards are equal -
__str__
= print out the word for a card
-
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Angelus Miculek
6,979 Points0 Answers
-
Stefan Rakocevic
3,402 Points2 Answers
-
cheeseslope
3,303 Points1 Answer
-
Caroline Todeschini
3,444 Points2 Answers
-
CD Lim
4,782 Points1 Answer
-
Akshaan Mazumdar
3,787 Points1 Answer
-
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points2 Answers
-
Eric Nachtsheim
2,006 Points1 Answer
-
Ameen Noushad
2,799 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
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