Re: totally lost newbie

2007-05-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steve Howell wrote: >> def key_func(item): >> return (len(item), item) >> >> data = ['viking', 'spam', 'parrot', 'ham', 'eric'] >> data.sort(key=key_func) >> print data >> > > Marc, when did the key feature get introduced, 2.4 or > 2.5? I'm asking on behalf of the n

Re: totally lost newbie

2007-05-27 Thread Steve Howell
--- mark <[EMAIL PROTECTED]> wrote: > Hi all > > I posted earlier on this but have changed my > approach so here is my > latest attempt at solving a problem. I have been > working on this for > around 12 hours straight and am still struggling > with it. > > Write a program that reads the values

Re: totally lost newbie

2007-05-27 Thread Steve Howell
--- Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > Maybe it's easier to use a key function instead of a > compare function. A > key function receives an element and must return > something that is then > sorted and the element ends up where the computed > key is in the sorted > list. L

Re: totally lost newbie

2007-05-27 Thread Gabriel Genellina
En Sun, 27 May 2007 07:19:15 -0300, mark <[EMAIL PROTECTED]> escribió: > I posted earlier on this but have changed my approach so here is my > latest attempt at solving a problem. I have been working on this for > around 12 hours straight and am still struggling with it. Almost done. Just two thi

Re: totally lost newbie

2007-05-27 Thread Kay Schluehr
On May 27, 12:19 pm, mark <[EMAIL PROTECTED]> wrote: > Hi all > > I posted earlier on this but have changed my approach so here is my > latest attempt at solving a problem. I have been working on this for > around 12 hours straight and am still struggling with it. > > Write a program that reads the

Re: totally lost newbie

2007-05-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, mark wrote: > Hi all > > I posted earlier on this but have changed my approach so here is my > latest attempt at solving a problem. I have been working on this for > around 12 hours straight and am still struggling with it. > > Write a program that reads the values for a

totally lost newbie

2007-05-27 Thread mark
Hi all I posted earlier on this but have changed my approach so here is my latest attempt at solving a problem. I have been working on this for around 12 hours straight and am still struggling with it. Write a program that reads the values for a random list of cards from a file, where each line i