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 trialGalina Yakovenko
iOS Development Techdegree Student 221 PointsGame.py Challenge: Answer that seems to be correct returns "Bummer"
I have entered my answer, which is exactly the same as the only posted by Gerald Wells here:
However, I keep getting a "bummer, try again" response. I even tried copying and pasting from Gerald Wells's answer, and it still does not work :,(
class Game:
def __init__(self):
self.current_score = [0, 0]
def score(player):
if player == 1:
self.current_score[0] += 1
else:
self.current_score[1] += 1
1 Answer
Jennifer Nordell
Treehouse TeacherOh you're soooo close! In fact, if I just add one single word, your code passes. The problem is that your method shouldn't just take a player, it should also take self
. Take a look:
def score(self, player):
If I copy/paste your code and then add the self
, your code passes! Hope this helps!
Galina Yakovenko
iOS Development Techdegree Student 221 PointsGalina Yakovenko
iOS Development Techdegree Student 221 PointsAugh! Thank you!!