I have a custom class called Game, and it has a variable called "goals". I'd 
like to make this a list of custom objects, with various information about the 
goals.
class Game:     goals = {}      class Goal(object):     def 
__init__(self,time,goal_by,assist_by,team,is_powerplay ):                   
self.time=time                  self.goal_by=goal_by                    
self.assist_by=assist_by                        self.team=team                  
self.is_powerplay=is_powerplay

Is that Goal class set up correctly? 
For an instance of Game called game, is this how you'd set a variable of a 
goal?game.goals[i].time= time 

I'm finding how python does data classes INCREDIBLY confusing, for whatever 
reason, so any help would be appreciated.
Thanks,Kate
                                          
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to