Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-09 Thread Larry Hudson
On 06/08/2011 11:59 PM, Larry Hudson wrote: On 06/08/2011 01:09 PM, Cathy James wrote: I am almost there, but I need a little help: I would like to ... Here's one possible replacement. There are many other approaches as well. (This leaves the individual dogs as a (name, breed) tuple. It co

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-09 Thread Ethan Furman
Ethan Furman wrote: Larry Hudson wrote: On 06/08/2011 01:09 PM, Cathy James wrote: Dog Breed: ")) while not dogs: print("Goodbye!!") sys.exit() else: else does not belong with while. else works just fine with while; it is the path taken when the while is exhaust

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-09 Thread Ethan Furman
Larry Hudson wrote: On 06/08/2011 01:09 PM, Cathy James wrote: Dog Breed: ")) while not dogs: print("Goodbye!!") sys.exit() else: else does not belong with while. else works just fine with while; it is the path taken when the while is exhausted, but not broken ou

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-09 Thread Larry Hudson
On 06/08/2011 01:09 PM, Cathy James wrote: I am almost there, but I need a little help: I would like to a) print my dogs in the format index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread John Gordon
In Cathy James writes: > b) I would like to append to my list, but my line dogs.dogAppend() is > giving a TypeError: > for i in enumerate (self.dogAppend()): > TypeError: 'list' object is not callable > def dogAppend(self): > self.dogAppend = [] You have a method and a list that

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Benjamin Kaplan
On Wed, Jun 8, 2011 at 1:09 PM, Cathy James wrote: > I am almost there, but I need a little help: > > I would like to > > a) print my dogs in the format  index. name: breed as follows: > > 0. Mimi:Poodle > 1.Sunny: Beagle > 2. Bunny: German Shepard > I am getting > > (0, ('Mimi', 'Poodle')) . Mimi

Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Ethan Furman
Cathy James wrote: I am almost there, but I need a little help: I would like to a) print my dogs in the format index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong? b) I wou

Of Functions, Objects, and Methods-I NEED HELP PLEASE

2011-06-08 Thread Cathy James
I am almost there, but I need a little help: I would like to a) print my dogs in the format index. name: breed as follows: 0. Mimi:Poodle 1.Sunny: Beagle 2. Bunny: German Shepard I am getting (0, ('Mimi', 'Poodle')) . Mimi : Poodle instead-what have I done wrong? b) I would like to append to