Re: Searching for Lottery drawing list of ticket match...

2011-08-12 Thread Miki Tebeka
It's the builtin "set", see http://docs.python.org/library/stdtypes.html#set-types-set-frozenset -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for Lottery drawing list of ticket match...

2011-08-12 Thread Chris Kaynor
On Fri, Aug 12, 2011 at 1:47 PM, MrPink wrote: > Boy, that was a lot more elegant that I would have thought. > Though hard for a greenhorn like me to really understand how the > assignment are working, etc. > > Anyway, what are these kind of statement call so that I can read up > more on this? >

Re: Searching for Lottery drawing list of ticket match...

2011-08-12 Thread MrPink
Boy, that was a lot more elegant that I would have thought. Though hard for a greenhorn like me to really understand how the assignment are working, etc. Anyway, what are these kind of statement call so that I can read up more on this? What Python feature are you using? num_whites = ticket_whit

Re: Searching for Lottery drawing list of ticket match...

2011-08-10 Thread Miki Tebeka
Python built in types are enough for this problem IMO. You can use sets of tuples to specify ticket and drawings and then just do set intersection. Say the drawing is set([(5, 'wb'), (1, 'wb'), (45, 'wb'), (23, 'wb'), (27, 'wb')]) (keeping black ball out). The you can create a score function: S

Searching for Lottery drawing list of ticket match...

2011-08-10 Thread MrPink
I need a little nudge into the right direction with this problem. As an exercise for me to learn about Python, I am trying to determine the best way to search a list of "lottery drawings" for a match with a lottery ticket. Possible numbers for a drawing are: 5 whiteballs (wb): 1-55 1 blackball (bb