Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Object-Oriented Python (retired) Inheritance __str__

Y B
Y B
14,136 Points

Error 'GameScore does not extend Game'?

I've no idea why this doesn't work - I haven't even really started the challenge yet?

game_str.py
from game import Game

class GameScore():
  pass

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

Your GameScore class isn't a subclass of Game. class GameScore(Game): is what you want.

Y B
Y B
14,136 Points

thanks did realise the question wanted it to be a subclass

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Sorry about that. I've updated the prompt to make it more obvious.

Do we replace the pass statement with a real statement after we have come to Challenge Task 2 of 2? Will it still pass Challenge Task 1 of 2 after, as I often get that "Task 1 no longer passing in code challenge:" in process of working through code challenges.

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Rune Larsen It's generally best to remove pass, yes, but so long as the rest of your code comes before the pass, you should be OK.

If it's acting up, feel free to make a post and share your code. I'm happy to take a look.