On Monday, February 8, 2016 at 7:05:24 PM UTC-5, Chris Angelico wrote:
> On Tue, Feb 9, 2016 at 8:45 AM, MrPink wrote:
> > I load the lottery drawings into memory for searching with the following
> > code although, it is incomplete. I am stuck and need some guidance.
> >
This is a continuation of my pursuit to learn Python. I have been tinkering
with this for a number of years and I am back at it again. I am stuck and need
some guidance.
This is related to other posts that I have made in the past.
For example: Searching for Lottery drawing list of ticket matc
understand a little better what a tuple is and can follow the
code better.
A namedtuple seems like a dictionary type. I'll need to read up on
the difference between the two.
Thanks again.
On Oct 15, 12:47 am, Chris Rebert wrote:
> On Fri, Oct 14, 2011 at 7:59 PM,MrPink wrote:
> >
y for key in keys if 20110909 <= key <= 20111212]
How would I search for matching wb (White Balls) in the drawings?
Is there a better way to organize the data so that it will be flexible
enough for different types of searches?
Search by date range, search by pb, search by wb matches, etc
Is there a function in Python that can be used to test if the value in
a string is an integer? I had to make one up for myself and it looks
like this:
def isInt(s):
try:
i = int(s)
return True
except ValueError:
return False
--
http://mail.python.org/mailman/list
I have a list like so:
a = [2,4,5,6,3,9,10,34,39,59,20,15,13,14]
I would like to get a subset from the list with value between 10 and
20 (inclusive).
b = [10,13,15,14,20]
Is there a way to do this with a list or other data type?
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
This is a continuing to a post I made in August:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/b072cfadf998deae/ce6d4d09911e4107?lnk=gst&q=MrPink#ce6d4d09911e4107
I got some free time to work with Python again and have some followup
questions.
For example, I have a lis
I found this solution.
Python: Convert String Date to Date Object
http://slaptijack.com/programming/python-convert-string-date-to-date-object/
On Aug 13, 3:14 pm, MrPink wrote:
> Is this the correct way to convert a String into a Date?
> I only have dates and no time.
>
> import ti
t; dt1 == dt2
> False
> >>> dt1 > dt2
> False
> >>> dt1 < dt2
> True
> >>> dt1 - dt2
> datetime.timedelta(-1)
>
> On 13/08/11 21:26, MrPink wrote:
>
>
>
>
>
>
>
> > I have file of records delimited by spaces.
> > I need t
ed that my oDate is not an object, but a structure and
not a date datatype.
I'm stumped. Is there a way to convert a string into a date datatype
for comparisons, equality, etc?
Thanks,
On Aug 13, 3:14 pm, MrPink wrote:
> Is this the correct way to convert a String into a Date?
Is this the correct way to convert a String into a Date?
I only have dates and no time.
import time, datetime
oDate = time.strptime('07/27/2011', '%m/%d/%Y')
print oDate
Thanks,
--
http://mail.python.org/mailman/listinfo/python-list
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
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
13 matches
Mail list logo