Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #3728

mystery string code - help!

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.16.MISMATCH!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!cu4g2000vbb.googlegroups.com!not-for-mail
From Uncle Ben <ben@greenba.com>
Newsgroups comp.lang.python
Subject mystery string code - help!
Date Wed, 20 Apr 2011 09:48:30 -0700 (PDT)
Organization http://groups.google.com
Lines 16
Message-ID <801e7013-ac1f-4b77-9783-dfdfd5b86149@cu4g2000vbb.googlegroups.com> (permalink)
NNTP-Posting-Host 67.252.22.57
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1303318110 19026 127.0.0.1 (20 Apr 2011 16:48:30 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 20 Apr 2011 16:48:30 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info cu4g2000vbb.googlegroups.com; posting-host=67.252.22.57; posting-account=15T5jAkAAACpO9KgK0Ue212ywoAPQtp7
User-Agent G2/1.0
X-HTTP-UserAgent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MAGW; Tablet PC 2.0; .NET4.0C; .NET4.0E),gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:3728

Show key headers only | View raw


I found this in one of the online cookbooks:

#Raghunath Reddy Peesari 6 years, 3 months ago  # | flag
#There is more simple way. ###

a = 'abcdefghi'
a = a[::-1]

print a

>>> 'ihgfedcba'

As a newbie Pythoner, I understand [] -1]
but would some tell me how '::' does its magic?

Uncle Ben

Back to comp.lang.python | Previous | NextNext in thread | Find similar


Thread

mystery string code - help! Uncle Ben <ben@greenba.com> - 2011-04-20 09:48 -0700
  Re: mystery string code - help! Dan M <catdude@gmail.com> - 2011-04-20 17:01 +0000
    Re: mystery string code - help! Uncle Ben <ben@greenba.com> - 2011-04-20 17:58 -0700

csiph-web