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 trialdaeweon seo
620 PointsI'm not sure about the explanation of question. Does player argument mean that player taken by **kwargs?
I already had created score method, but they couldn't figure out that
class Game:
def __init__(self):
self.current_score = [0, 0]
self.player = self.score()
self.current[self.player] += 1
def score(self):
player = input("player: ")
return player
1 Answer
Chris Freeman
Treehouse Moderator 68,454 PointsIn this challenge, "taking a player argument" is a way of saying define a method with some parameter that will be assigned the argument value when the method is called. Something like def score(self, player)
Additional Hint: In the body of the score
method, a return
is not needed. Instead assign update self.current_score
appropriately based on the value of player