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 trialHideki Matsuura
3,860 PointsI don't understand what we are supposed to do.
I don't get the instructions.
class Game:
def __init__(self):
self.current_score = [0, 0]
def score(self, player):
1 Answer
James J. McCombie
Python Web Development Techdegree Graduate 21,199 Pointsscore will take either 1, or 2, as the player argument.
inside score you want to increase the value of self.current_score at index 0, if player = 1, and increase the value of self.current_score at index 1, if player = 2.
self.current_score is a list and can be indexed into with [].
so depending on what player is, 1 or 2, you have to index into the list, and increment the value at the correct index by one
Hideki Matsuura
3,860 PointsHideki Matsuura
3,860 PointsThanks