Hi,
I had a quick question on how string compare works. If did '1001' <= '999'
I get true. I know how the string compare works but I was wondering why it
were so. Why doesn't the string length factor into the comparison? For
example, If I compared character-by-character but also found how differen
On 31/05/13 21:49, Nick Shemonsky wrote:
I did stumble upon using reduce ...but I didn't really
understand what it was doing
def product(intlist):
return reduce(operator.mul, intlist)
I explain reduce thusly in my Functional Programming topic:
-
The reduce function
On 05/31/2013 04:49 PM, Nick Shemonsky wrote:
Here's the final code... I kept the if statement that way if I throw
in a random series of numbers that isn't evenly divisible by 5, it'll
always work itself out. And this answered the 1000 digit problem
without issue.
str_num = '1234567890'
n =
Thanks for the responses. I am using python 2.7. I'm not new to
programming but might as well be... I last programmed heavily about a
decade ago in college. I was a MIS major so I did my fair share of
c++, sql, and php work but now I'm a windows sys admin so I haven't
used it much at all in a long
> Phah! If you think Learning Python is big take a look at his Programming
> Python opus - around 1250 pages in my second edition.
>
> :-)
That's waiting in the wings if I ever get done with the first book,
where he mentions offhand, while taking an entire chapter to explain
the differences betwee
On 31/05/13 19:23, Nick Shemonsky wrote:
or maybe it'd be quicker to compare a to b through each iteration and
just keep the larger product rather than creating a giant list
You are probably right if it is a giant list.
str_num = '1234567890'
n = 5
strings = [str_num[i:i+5] for i in range(0
On 31/05/13 20:41, Jim Mooney wrote:
... the Lutz book (Learning Python - O'Reilly) is Big
Phah! If you think Learning Python is big take a look at his Programming
Python opus - around 1250 pages in my second edition.
:-)
Mind you I deliberately set an upper limit of 300 pages
for my origi
It does however seem
> to remember my last style and just use that again.
I'd like a default - choose rich text when I need it but always go
back to the default. But like Javascript's annoying habit of deciding
your type invisibly, with arcane rules (one reason I switched to
Python), Gmail someti
On 05/31/2013 02:23 PM, Nick Shemonsky wrote:
Hey there everybody. I'm new to python
Welcome. But are you new to programming, or just to Python in
particular? And which Python? I'd guess 2.7
and am attempting to teach
myself to code while brushing up on my math skills via the problems at
Hey there everybody. I'm new to python and am attempting to teach
myself to code while brushing up on my math skills via the problems at
projecteuler.net. My solutions thus far have been mostly brute force
and this is no exception but I'm having an issue with tackling some
iteration in the problem.
eryksun wrote:
>
> Also, when you post code remember to use less than 70 characters per
> line. Gmail has a 'feature' to automatically hard wrap plain-text
> messages at about 70 characters, which it applies *after* you send
> (i.e. there's no indicator in the composer... brilliant).
It is not th
Jim Mooney wrote:
> Sent: Saturday, May 25, 2013 10:21 PM
> To: tutor@python.org
> Subject: [Tutor] got text switched
>
> Oops, Gmail switched me back to rich text. My apologies. Back to plain
> ;') I wish I could automate the mode, per-recipient, since I do need
> rich text for some things. The
I didn't see this in the archive so I thought I'd mention it since
it's pretty new. According to Ray Kurzweil, the most advanced
publicly-available Artificial Intelligence framework is now available,
exclusively for Python 2.7 installation, as RLPy (Reinforcement
Learning and Python)
http://www.ku
- Original Message -
> From: eryksun
> To: Albert-Jan Roskam
> Cc: Dave Angel ; "tutor@python.org"
> Sent: Thursday, May 30, 2013 10:05 PM
> Subject: Re: [Tutor] walk registry using _winreg
>
> On Thu, May 30, 2013 at 10:47 AM, Albert-Jan Roskam
> wrote:
>>
>> def walkRegistry(regk
14 matches
Mail list logo