totally lost newbie

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sun May 27 06:48:54 EDT 2007


En Sun, 27 May 2007 07:19:15 -0300, mark <j25bravo at gmail.com> 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 things:
- You have defined a function to convert the file format into tuples. But  
you are not consistent with the ordering: in the file they come  
rank+space+suit. When you convert to tuple you use (suit,rank). Inside the  
comparison function you use a[0] as rank and a[1] as suit again. Be  
consistent.
- The sort expects a list of tuples, but you still use the lines read from  
the file; you forgot to call the function above to convert them.

-- 
Gabriel Genellina




More information about the Python-list mailing list