"gregarican" <[EMAIL PROTECTED]> writes:
> reversed(a_string) (python)
>
> Which version of Python offers this function? It doesn't seem to be
> available in the 2.3 version I have installed...
>
I think it's new in 2.4.
--
http://mail.python.org/mailman/listinfo/python-list
BWill wrote:
> and ixnay on the ubyray or else I'll tell you where to stick your
> endblock delimiter :P
Umm,
Did you mean to write the above?
What has it to do with Ruby?
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> Darn, yes, that's the second time in the past couple weeks I've made
> that exact same error in a clpy post. So what's the most concise way
> of turning it back into a string? ''.join(list(reversed(a_string))) ?
> Bleccch.
Use Ruby:
print "A String".reverse
Just kidding :
Paul Rubin wrote:
> So what's the most concise way
> of turning it back into a string? ''.join(list(reversed(a_string))) ?
You don't need the list(), join() can take an iterator:
''.join(reversed(a_string))
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten <[EMAIL PROTECTED]> writes:
> >>> print reversed("abba")
>
Darn, yes, that's the second time in the past couple weeks I've made
that exact same error in a clpy post. So what's the most concise way
of turning it back into a string? ''.join(list(reversed(a_string))) ?
Bleccch.
--
htt
Paul Rubin wrote:
> "gregarican" <[EMAIL PROTECTED]> writes:
>> > reversed(a_string) (python)
>>
>> Which version of Python offers this function? It doesn't seem to be
>> available in the 2.3 version I have installed...
>
> I think it's new in 2.4.
Needs a little help, though:
>>> print re
"gregarican" <[EMAIL PROTECTED]> writes:
> > reversed(a_string) (python)
>
> Which version of Python offers this function? It doesn't seem to be
> available in the 2.3 version I have installed...
I think it's new in 2.4.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
> reversed(a_string) (python)
Which version of Python offers this function? It doesn't seem to be
available in the 2.3 version I have installed...
--
http://mail.python.org/mailman/listinfo/python-list
rtilley <[EMAIL PROTECTED]> writes:
> a_string.reverse (ruby)
> a_string[::-1](python)
reversed(a_string) (python)
--
http://mail.python.org/mailman/listinfo/python-list
BWill wrote:
> and ixnay on the ubyray or else I'll tell you where to stick your
> endblock delimiter :P
OK, I can't help it... which is more readable:
a_string.reverse(ruby)
a_string[::-1] (python)
--
http://mail.python.org/mailman/listinfo/python-list
al pacino wrote:
> Paddy wrote:
>> Spread the love - tell your Java freinds :-)
>
> well said paddy ! :-))
>
and ixnay on the ubyray or else I'll tell you where to stick your
endblock delimiter :P
--
http://mail.python.org/mailman/listinfo/python-list
Paddy wrote:
> Spread the love - tell your Java freinds :-)
well said paddy ! :-))
--
http://mail.python.org/mailman/listinfo/python-list
Spread the love - tell your Java freinds :-)
--
http://mail.python.org/mailman/listinfo/python-list
I've only been goofing around with Python for about a month now, but
already I am in love.
I never get that feeling -- so common with Java -- that I'm swimming
upstream, struggling to force the language to do what I want.
Python makes it feel effortless and easy.
--
http://mail.python.org/mailman
14 matches
Mail list logo