Re: [Tutor] basic class loading question

2011-11-24 Thread Karim Meiborg
Cranky Frankie wrote: > OK, but this is still not working: > > class Qb: > def __init__(self, first_name='', last_name='', phone='', > email='', stadium=''): > self.first_name = first_name > self.last_name = last_name > self.phone = phone > self.email = email >

Re: [Tutor] basic class loading question

2011-11-23 Thread Emile van Sebille
On 11/22/2011 11:25 AM Cranky Frankie said... quarterbacks = [] # Create an empty object list In the interest of preferred techniques, your loop will be more pythonic when you write this part... len_Qb_list = len(Qb_list) # Get the lenght of the list of

Re: [Tutor] basic class loading question

2011-11-22 Thread Alan Gauld
On 22/11/11 17:09, Cranky Frankie wrote: Dave I'm sorry but I just don't get this. I have virtually no experience with classes. You need to step back and rethink the terminology a bit. A class is a cookie cutter for creating objects. Objects are instances of the class. What seems like it sh

Re: [Tutor] basic class loading question

2011-11-22 Thread Dave Angel
On 11/22/2011 12:09 PM, Cranky Frankie wrote: On Tue, Nov 22, 2011 at 11:26 AM, Dave Angel wrote: snip quarterbacks = [] for quarterbacks.append( ) Now that you really have a list, then you can print a particular one with: print (quarterbacks[2].last_name) Dave I'm sorry but

Re: [Tutor] basic class loading question

2011-11-22 Thread Cranky Frankie
On Tue, Nov 22, 2011 at 11:26 AM, Dave Angel wrote: snip > quarterbacks = [] > for >     quarterbacks.append(       ) > > > Now that you really have a list, then you can print a particular one with: > > print (quarterbacks[2].last_name) Dave I'm sorry but I just don't get this. I have virtua

Re: [Tutor] basic class loading question

2011-11-22 Thread Dave Angel
On 11/22/2011 09:20 AM, Cranky Frankie wrote: OK, but this is still not working: class Qb: def __init__(self, first_name='', last_name='', phone='', email='', stadium=''): self.first_name = first_name self.last_name = last_name self.phone = phone self.ema

Re: [Tutor] basic class loading question

2011-11-22 Thread Cranky Frankie
OK, but this is still not working: class Qb: def __init__(self, first_name='', last_name='', phone='', email='', stadium=''): self.first_name = first_name self.last_name = last_name self.phone = phone self.email = email self.stadium = stadium Qb_list

Re: [Tutor] basic class loading question

2011-11-22 Thread Dave Angel
On 11/22/2011 08:17 AM, Cranky Frankie wrote: I have a basic question about how to load a class. If I have this class: class QB: def __init__(self, first_name='', last_name='', phone='', email='', stadium=''): self.first_name = first_name self.last_name = last_name