Welcome to the Treehouse Community
Looking to learn something new?
Justin Noor3,692 Points
What are the bracket for in self.current_score = [0, 0] ?
I got this to work but never fully understood what the brackets are for in the self.current_score = [0, 0] line.
class Game: def __init__(self): self.current_score = [0, 0]
Andrew Smith10,947 Points
The brackets create a list. The first item in the list tracks Player 1's score while the second track's Player 2's score. The method you are asked to create takes the argument which tells you which player scored and you increase either the first or second item in the list based on that argument.
The brackets is a list that hold default values. Each player starts with a score of 0.