On Sun, Apr 12, 2015 at 6:47 PM, Ben Finney wrote:
[...]
> One important principle to follow is to write your statements to be very
> simple, so that when something goes wrong it is as easy as possible to
> read the statement and understand what it *actually* says.
+1! This principle I have fou
On Sun, Apr 12, 2015 at 11:03:07AM -0700, Jim Mooney wrote:
> If join returns a string, why am I getting a syntax error when I try to
> slice it?
Because you have a syntax error. Syntax error means you have written
something which the Python compiler cannot understand, because the
syntax is wr
Jim Mooney writes:
> If join returns a string, why am I getting a syntax error when I try to
> slice it?
>
> >>> 'alfabeta'[2:5]
> 'fab'
> >>> ''.join(['a', 'l', 'f', 'a', 'b', 'e', 't', 'a')[2:5]
> SyntaxError: invalid syntax
This demonstrates the primary problem with so-called “chaining”. You
Laura Creighton writes:
> In a message of Sun, 12 Apr 2015 18:05:16 +1000, Ben Finney writes:
> >Please disable that in order to receive individual messages, so you
> >can participate properly: responding to individual messages that the
> >rest of us see.
>
> Or see if your mailer, like mine, has
On Apr 12, 2015 4:00 PM, "Jim Mooney" wrote:
>
> If join returns a string, why am I getting a syntax error when I try to
> slice it?
>
> >>> 'alfabeta'[2:5]
> 'fab'
> >>> ''.join(['a', 'l', 'f', 'a', 'b', 'e', 't', 'a')[2:5]
> SyntaxError: invalid syntax
If you're seeing a SyntaxError, don't loo
If join returns a string, why am I getting a syntax error when I try to
slice it?
>>> 'alfabeta'[2:5]
'fab'
>>> ''.join(['a', 'l', 'f', 'a', 'b', 'e', 't', 'a')[2:5]
SyntaxError: invalid syntax
--
Jim
___
Tutor maillist - Tutor@python.org
To unsubsc
On 12/04/15 11:16, Timo wrote:
Personally I think it would help if the first lines
for these methods read like:
remove(...) -> None
L.remove...etc
Are you using Python 2? Because this is what I get in Python 3:
Yes, I just fired up the default python which is 2.7.
I never thought to che
In a message of Sun, 12 Apr 2015 18:05:16 +1000, Ben Finney writes:
>Jim, you are evidently receiving “digest” messages from this forum.
>
>Please disable that in order to receive individual messages, so you can
>participate properly: responding to individual messages that the rest of
>us see.
>
>E
In a message of Sun, 12 Apr 2015 10:25:54 +0400, "Vick" writes:
>S 0 to 1e+31> 1/sqrt(.86 *(1+z)^4 + .282 * (1+z)^3 - .86
>*(1+z)^2 + .718) if you try this integration you will get completely
>wrong numbers on computing devices that do not possess ultra-high precision
>and accuracy.
Op 12-04-15 om 09:58 schreef Alan Gauld:
Aside:
Normally you would use the help() function to find out
how methods work and what they return but sadly the
documentation for the in-place methods doesn't indicate
the return is None. Some of them have a warning that
its "IN PLACE" but remove does n
Vick wrote:
> So can Fortran crunch 250 digits numbers in an integration formula under 3
> seconds with the same computing parameters as above? Or is Python better
> at it?
So by better you mean faster.
Pure CPython is usually much slower than Fortran, but as there are many
optimised libraries
Jim Mooney writes:
> That's really cool. Worth making a dumb mistake to find it out ;')
Jim, you are evidently receiving “digest” messages from this forum.
Please disable that in order to receive individual messages, so you can
participate properly: responding to individual messages that the re
On 12/04/15 07:06, Jim Mooney wrote:
I thought I'd get [2,3,4,5] from this but instead I get nothing. Why isn't
it chaining?
q = list(set([1,2,3,1,4,1,5,1,5])).remove(1)
q
Because that's just the way it was designed. It's common in
Python for methods that modify an object to return None.
I d
> Range objects are special: not only do they produce values lazily as
> needed, but they also support len(), indexing, slicing, and membership
> testing, none of which generators are capable of doing:
>
> Steve
-
That's really cool. Worth making a dumb mistake to find it out ;')
Jim
Today is
I thought I'd get [2,3,4,5] from this but instead I get nothing. Why isn't
it chaining?
>>> q = list(set([1,2,3,1,4,1,5,1,5])).remove(1)
>>> q
>>>
--
Jim
Today is the day that would have been yesterday if tomorrow was today
___
Tutor maillist - Tuto
15 matches
Mail list logo