Chris wrote:
> It's very beautiful. Thanks
You think that's beautiful? Try these:
'abcdef'[::-1]
'abcdef'[::-2]
Cheers,
John
--
http://mail.python.org/mailman/listinfo/python-list
It's very beautiful. Thanks
jwoolard wrote:
> Chris wrote:
> > is there a prettier way to do this?
> > string[:len(string)-1]
> >
> > thanks!
>
> string[:-1]
>
> Negative indices count from the end of the string! beautiful isn't it?
--
http://mail.python.org/mailman/listinfo/python-list
Chris wrote:
> is there a prettier way to do this?
> string[:len(string)-1]
>
> thanks!
string[:-1]
Negative indices count from the end of the string! beautiful isn't it?
--
http://mail.python.org/mailman/listinfo/python-list
is there a prettier way to do this?
string[:len(string)-1]
thanks!
--
http://mail.python.org/mailman/listinfo/python-list