The function I wrote (below) reverses lists all right:
def reverse(xs):
if xs == []:
return []
else:
return (reverse (xs[1:])) + [xs[0]]
>>> reverse ([1,2,3])
[3, 2, 1]
>>>
Yet when I try to reverse a string I get:
>>> reverse ("abc")
...
...
...
File "C:\wks\pyth
g a reversed copy of either a string or a list, but what
does '::-1' syntax means?
Thanks,
Dmitri O. Kondratiev
[EMAIL PROTECTED]
http://www.geocities.com/dkondr
On 10/15/07, Gary Herron <[EMAIL PROTECTED]> wrote:
>
> Dmitri O.Kondratiev wrote:
> >
> >
?
Thanks,
--
Dmitri O. Kondratiev
[EMAIL PROTECTED]
http://www.geocities.com/dkondr
On 10/15/07, Dmitri O.Kondratiev <[EMAIL PROTECTED]> wrote:
>
> Gary, thanks for lots of info!
> Python strings are not lists! I got it now. That's a pity, I need two
> different functions: one to
On 10/16/07, Matt McCredie <[EMAIL PROTECTED]> wrote:
[quote]
> The example you posted won't work with tuples either because they,
> like strings, are also immutable. So, the best way to get the posted
> code to work (which is a bad way to go about reversing a string, but I
> digress)
>
[end-quote
Need advice:
What library can Python client use to access CORBA server using DII (Dynamic
Invocation Interface) ?
Thanks,
Dima
--
http://mail.python.org/mailman/listinfo/python-list
What Python module / function can be used to get millisecond timestamps?
time.time() returns the time as a floating point number expressed in seconds
since the epoch, in UTC.
Thanks!
--
Dmitri O. Kondratiev
[EMAIL PROTECTED]
http://www.geocities.com/dkondr
--
http://mail.python.org/mailman/listi
Please help to find simple solutiion for measuring times of operations with
millisecond precision.
For this I am trying to use datetime() objects:
import time
import datetime
def dreamTime(secs):
t1 = datetime.datetime.now()
time.sleep(secs)
t2 = datetime.datetime.now()
dt = t2 -
ect
]<http://mail.python.org/pipermail/python-list/2007-December/subject.html#469507>
[
author
]<http://mail.python.org/pipermail/python-list/2007-December/author.html#469507>
------
En Wed, 12 Dec 2007 11:40:24 -0300, Dmitri O.Kondratiev
http://mail.python.org/
y have a library with *extra* datetime functions (and better
written then these ones) please let me know!
--
Dmitri O. Kondratiev
[EMAIL PROTECTED]
http://www.geocities.com/dkondr
*Dmitri O.Kondratiev* dokondr at
gmail.comwrote:
*Thu Dec 13 16:19:35 CET 2007*
- Previous message: to Doctest as