I’m trying to call a class method that takes 3 arguments. However, after I instantiate the class and call it with the method I’m getting a NameError: name ‘lions’ is not defined, even though ‘lions’ is a class variable. I thought class variables were available to be called in any instantiation of the class??..
lions_vs_cobras = [24, 36]
lions = 24
cobras = 36
def game_score(self, points_scored, team): if team == self.lions: self.lions_vs_cobras += points_scored self.lions += points_scored elif team == self.cobras: self.lions_vs_cobras += points_scored self.cobras += points_scored
game_one = Points()
team_name = Points()
game_one_scores = game_one.game_score(24, lions)