Re: super quick question

2006-08-04 Thread John Machin
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

Re: super quick question

2006-08-04 Thread Chris
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

Re: super quick question

2006-08-04 Thread jwoolard
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

super quick question

2006-08-04 Thread Chris
is there a prettier way to do this? string[:len(string)-1] thanks! -- http://mail.python.org/mailman/listinfo/python-list